-
Notifications
You must be signed in to change notification settings - Fork 9
Player Death
Player Death implements both a death screen, which shows up after the player's health reaches zero, as well as a death animation of the player's character, which is shown before the death screen pops up. The player death event is integral to the game's function, as it gives meaning to the player's health and the enemies' attacks. Once the player dies, they are given the choice to respawn or exit to the main menu screen.
Player death is closely linked to Player Lives since four death screen images must be created to accommodate for the player having either 3, 2, 1, or 0 lives remaining. Furthermore, after the player dies with zero lives remaining, they will no longer be given the option to respawn into the current game, and instead must exit to the main menu and restart.
Death animation assets were sourced from a free skeleton asset pack and were selected to show the player dying by becoming a skeleton and crumbling. Since the pixel layout matches that of the player assets (16x16 pixels), it aligns with the Game Design objective.
The death screen was designed using the chosen font of Kenvector Future Thin and hearts closely resembling that of Minecraft. The two options given to the player are to either respawn in the current level or exit to the main menu (and thus restart the game).
The skeleton asset pack is seen below:
The death screen image is seen below:
-
DeathScreenActions
class was created to implement the events of respawning the player in theMainGameScreen
or exiting to theMainMenuScreen
. -
DeathScreenDisplay
class was created to implement the UI of the two buttons (Respawn and Exit to Main Menu). -
PlayerDeathScreen
class was created to implement both theDeathScreenActions
and theDeathScreenDisplay
. -
CombatStatsComponent
was modified to trigger the change of screen display to thePlayerDeathScreen
when the player's health reaches zero (in thesetHealth
function). This is triggered 750ms after the player's 'death', to allow time for the death animation to play.
-
player.png
andplayer.atlas
image/file were modified to include the skeleton death animation ("Character_Death") and the reference to it. -
PlayerFactory
class was modified to add the animation of the "Character_Death". -
CombatStatsComponent
was modified to trigger the player's death animation when the player's health reaches zero. -
PlayerAnimationController
was modified to include ananimateDeath
function, which starts the "Character_Death" animation. -
MainGameScreen
was modified to include aninitiateDeathScreen
function, which renders thePlayerDeathScreen
.
The death screen has been tested according to the Player Death Testing Plan.
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