Friday, August 29, 2008

Thinking Ahead: Design

The last few days have really put a lot of information forward. We know how to handle a lot of different variable: text, number, arrays, local, and global. We know how to pass them to and from different functions. We even know how to use them to determine what the program should do next.
But we still do not know enough to make a game. We really won't for a while yet, but I thought an exercise in what we have learned so far might be a little fun. So that is what we are going to do. We are going to SIMULATE a game in the console window.
First though, we need an idea. That is where thinking ahead comes in. If we plot out enough information into our "Design Document" it will make the programming a lot easier. Soooo...here it goes:
============================================================================
Game Title: Arena Duel
Synopsis: Wally the Warrior and Ralph the Rogue have been friends since they first met at the melee academy. Unfortunately, at the graduation ceremony they both realized that they were in love with the same girl. As part of graduation they must pick an opponent from their class and fight to the death. The winner graduates, and in the case of Wally and Ralph, gets the girl.
Game Play: In this case both Wally and Ralph will be played by the computer. The computer will attempt to make the most of the attack moves available to Wally and Ralph to determine the winner. No maneuvering is allowed in the arena, so movement is not an option.
Output: Text will describe the location, health, and status of each character. It will also describe combat as it progresses until ultimately only the winner remains.
Character Info:
Wally the Warrior
Health: 120
Armor: 100
Dodge: .1
Parry: .1
Attack: 5
Special 1: Shield Stun (Stuns for 3 rounds, 10 round cooldown)
Special 2: Healing Potion (Heals 25 health single use)

Ralph the Rogue
Health: 80
Armor: 30
Dodge: .3
Parry: .2
Attack: 8
Special 1: Bleeding Gash (Target takes 2 dmg per round for 5 rounds. Prevent Healing. 10 round cool down)
Special 2: Healing Potion (Heals 25 health single use)


Order of Events:

=1.) Initialize all variables
= a. Wally
= b. Ralph
= c. Variables for combat processing
=2.) Initiative
= a. Check status. Does it prevent from attacking?
= b. Roll random 0-1
= i. If 0, wally attacks first this round
= ii. If 1 ralph attacks first this round
= c. Call function for first attacker
= d. Call function for second attacker
=3.) Combat
= a. Wally attacks
= i. Is Wally below 60 health?
= 1. No, continue attack
= 2. Yes
= a. Is Wally bleeding?
= i. Yes, continue attack
= ii. No, use potion
= ii. Check cooldown on Shield Stun
= 1. If on cool down, regular attack
= 2. If not on cool down, use stun
= iii. Check to see if Ralph is still alive
= 1. If yes, continue
= 2. If no, declare wally the winner
= b. Ralph attacks
= i. Is Ralph stunned
= 1. No, continue attack
= 2. Yes, pass attack turn
= ii. Is Ralph below 40 health?
= 1. Yes, use potion
= 2. No, continue attack
= iii. Check cooldown on Bleeding Gash
= 1. If on cool down, regular attack
= 2. If not on cooldown, us BG
= iv. Is Wally still alive?
= 1. Yes, continue
= 2. No, declare Ralph the winner
=4.) End Round
= a. Is wally bleeding?
= i. Update character status
= b. Is Ralph stunned?
= i. Update character status
= c. Special ability cooldowns
= i. Decrease shield stun countdown by 1 (if it isn’t zero)
= ii. Decrease bg countdown by 1 (if it isn’t zero)


There we go! Now that is a pretty decent little design document for our little skillset showcase! (please forgive the = signs, it was the only way I could get it to save my formatting in Blogger.)

Tomorrow we will move forward with Arena Duel! Lets see if a few little variables, functions, and if statements can determine who will win the girl!

No comments: