2.2.5 Cycle 5 - Grunts
Last updated
Last updated
In the fifth cycle, my objectives are to implement hostile enemies into the game. For now, I will only be adding the Grunt as detailed in . At this point, the Grunts don't need to be too detailed, a simple shape or image will do.
The Player will have to avoid the Grunts since they will cause the Player to die and the game to end. This will add excitement to the game since there is now a risk factor.
FALL_DEATH
Determines the 'y value' for death when the Player's character is falling.
The pseudocode for the hostile Grunts is shown below:
The player is now faced with the Grunt opponents when the game begins, the code for this can be viewed below:
Some challenges I faced during this cycle:
The Grunts movement was difficult to implement because they wouldn't comply with the gravity which was set.
Tests performed in this cycle are evidenced below, they were a crucial aspect to my development.
1
Run code.
The game to start, boundaries rendered, player and Grunt placed.
As expected
Pass
2
Collide the Player's character with the Grunt.
The Player loses the game and the game is reset.
As expected
Pass
The screen recording below shows the rendered sprite after moving from its original position, it completes the following tasks for this cycle:
Add Grunts as specified in .