-
Notifications
You must be signed in to change notification settings - Fork 9
Player Lives
Player Lives allows the player to respawn in the current level numerous times (dependent on the number of lives the player has remaining). The original number of lives given to a player is set at 3, however, an 'Extra Life' powerup, as implemented in Improved Powerups, increases player lives by 1 and therefore allows for another respawn. However, the number of lives is maxed out at 4, to not give the player too much of an advantage in the game. The number of lives is visible both in the main game and on the death screens when the player dies.
NOTE: if a player has three lives remaining, they are able to respawn two times; if a player has two lives remaining, they are able to respawn once more etc.
Dying with one life remaining forces the player to exit to the main menu and restart the game.
The death screens were updated to include the number of player lives remaining, and the font was changed to Jura in order to align with the Game Design objective. An example of the new death screen image (three hearts represent three lives remaining) is seen below:
The player lives stats display (three hearts represent three lives remaining) can also be seen below:
-
DeathScreenActions
andMainGameActions
classes were updated to reset the number of lives to 3 when the player decides to quit the game and return to theMainMenuScreen
(by clicking theExit
button). -
PlayerDeathScreen
class was updated to include thelives
variable, in order for the correct player death screen to be displayed (as triggered in theinitiateDeathScreen
function in theMapGameArea
class). -
CombatStatsComponent
class was modified to decrease the number of player lives by 1 when the player's health reaches zero (in thesetHealth
function). -
PlanetScreen
class was modified to set the number of lives the player has when spawned into the game to the stored variable in theGdxGame
class. -
GdxGame
class was updated to include a variablelives
, as well as setter and getter methods, in order for it to be accessible to all other classes and to maintain the number of player lives across different levels. -
PlayerStatsDisplay
class was updated to include the number of lives the player has left, as represented by the number of hearts remaining, and an alert if the max number of player lives (4) has been reached. -
player.json
config is updated to include the number of lives originally given to a player (3 lives).
Player lives has been tested in relation to the death screen, and therefore the exitsing Player Death Testing Plan has been updated in accordance with the new lives functionality.
Further, the Powerup Testing Plan has also been updated to include testing for the "extra life" powerup.
To enlarge: Right click -> Open image in new tab
Escape Earth Game
Interaction Controller and Interactable Components
Game and Entity Configuration Files
Loading Game Configuration Files