Week 6: Developer Journal


This week continued on with purely development work of the project.

While rather a small change the attacking assets being loaded has been changed so instead of using a whole sprite sheet as it did before. Instead using one frame of the animation with the height and width of it for more accurate attacking over how it was before with the oversized area of the animation causing misalignment to where attacks that looked like should hit didn’t before.
While the logic for spawning the enemies of the first wave has not changed it has been changed to being controlled by a wave variable which increases when all enemies are killed to start the next wave or for call back to wave 1 if the player dies. Also added a total number of enemies to it to keep track of how many enemies are alive and once reaching 0 starting the next wave.
For wave 2 and beyond the logic for spawning the enemies had to change to accommodate what I wanted to do as with the implementation used for wave 1 it was only possible to spawn 1 row of enemies. This does this through a for loop and creating enemies at each desired position (same as the spawning for the previous level + same pattern for bottom of the screen).
Waves 3-5 (the rest of the waves) all have the same spawning of the enemies using the same logic as the previous wave and 2 extra enemies on the left and right side of the player.
Creating the group for the health collectible and overlap/collision with the player.
The first change to the attacking between the player and enemy overlap function is the enemy dying and taking away from the total number of enemies has been moved from the update function to here with the addition of the new health consumable being created at it’s position. Along with this is when the total enemies reaches 0 incrementing the wave number and calling the enemy create function to call the next wave. Also a minor change to the invulnerability of the player being increase from 60 to 240.
The function called when the player overlaps/collides with the health consumable. This adds 2 to the health of the player if adding it won’t go above 100 health otherwise it will set the player health to 100.
The Trello at the end of the week.