Finally, you'll need the mouse object to actually control the game. The third text object will be used to show the Game Over text. Similarly, two of the text objects will be for the player and opponent: an HP display for each. You can set these to whatever you like, I've chosen the same stats for both combatants – 50 HP, 15 Attack and 5 Speed. The three instance variables act as stats for our two combatants. The two combatant objects also have the Flash behavior applied to them, and several instance variables: HP, Attack and Speed. Two of the sprites will be our two combatants – the player and the opponent, and the third will be the attack button. To build the project, you'll need seven objects – three sprites, three text objects and the mouse object. This form is where we're going to start this course. When one loses its health, the battle is over. A basic form of a turn-based battle system can simply be two objects, taking it in turns to inflict a set amount of damage to each other.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
February 2023
Categories |