How combat works: an update #1

Since the last update, the core principles of how combat is done has remained the same. However a few small changes have been implemented.

The first of which is the order in which everything is done. In the old version, it went

  1. Declare who goes first at the start of the battle
  2. player turn (if faster), where they pick an attack
  3. enemy turn
  4. player turn (if slower), where they pick an attack

In the current version, the players attack is chosen before anything else is resolved, and then it is carried out when their turn comes around. Not only does this method seem more intuitive, it also serves to fix several bugs that arose when trying to implement it the other way.

Another change implemented is how enemies do damage to the player and are loaded into the battle. In the old version, enemies did a static damage whereas now they have a minimum and maximum damage, which is randomly chosen whenever they attack the player. 

In the current version, enemies are now loaded into the battle by a switch statement and an integer. There are 5 different enemies in the game, each stronger than the last. When the player flies through space, the area there are in effects what kind of enemies they encounter. For example, if the player flew around the starting area, there would be a high chance of encountering a Mook Wing, the weakest enemy in the game, but a small chance of encountering a stronger enemy as well.

Another important addition: rewards. At the end of every battle, the player will receive an amount of metal and fish as a reward for winning the fight. Much like damage, this is also a random value. Enemies have a minimum and maximum amount of fish and metal to yield on death.

Finally, we have a battle screen where combat takes place:Image