Finishing up the battle
Now, you are probably thinking at this point, What about the rest of the battle? Put simply, I leave that up to you.
You are now armed with everything you need to know to be able to complete the rest of the battle scene. You should not just stop there, however, and you should see just how far along you can get.
To complete the battle system, include various states using the following steps:
- Destroy enemies with health less than
1
. - Loop through the Dragons and let them attack the player; rough her up a bit.
- Update the player's health bar to display the correct HP.
- Check whether the battle is complete and, accordingly, either transition back to the Player Move state or set the
BattleReady
state variable tofalse
to transition to the Battle Result state. - Display a UI element to summarize the battle results and grant the user some reward, perhaps with some gold, after the battle has completed.
- Transition back to the map when the battle is over.
- Update the description text...