Player Health System - UQdeco2800/2021-ext-studio-1 GitHub Wiki
Overview
The main feature health system is the three heart system, where hits by enemies and obstacles decrease health by one heart. The player must come into direct contact with an enemy or obstacle for there to be loss of health. The health system also includes code that supports the ability for an armour system, where the player may pick up an armour powerup that increases defence. The armour system operates the same as the heart system, where one hit by an enemy or obstacle will remove 1 armour, and once all armour protection has been removed, all hits by enemies and obstacles will then decrease heart health. Finally, the health system includes code that supports ability to increase health, this would occur where the player encounters/picks up a powerup that increases the player health.
The reasoning for designing the health system as a three heart system was largely for simplicity, and being highly comprehensible. This is due to the fact that in future sprints, as other health related features are implemented (i.e. armour system and a system for increasing health beyond three hearts), the concept of the health system could potentially become overcomplicated. Additionally, from the viewpoint of the player, it is easier to visualise and process loss of health when the conversion is 1 hit = -1 heart. Additionally, utilising colours for each level of health (low, moderate and full), allows players to more easily comprehend the concept of deteriorating health, and aims to fulfil the emotional goal of creating a feeling of tension, suspense and desperation within the player, particularly when their health reaches critically low points.
Furthermore, the decision to implement an armour system was to increase the capabilities and options of the player within the game, as well as making the game slightly more complicated, and ideally more enjoyable than just having a basic health system.
The Player Health Bar
As the players heart health decreases, the game will present different stages of the heart health:
- Green: Three hearts signifying full health
- Yellow: Two hearts, signifying moderate health
- Red: One heart, signifying low health
- Black: No hearts, an absent health bar, signifying no health, which will then end the game as the player has been defeated.
The player health bar utilises the health method in getHealth(int health) in order to display the appropriate status of the health bar. Additionally, it utilises addHealth(int health) which is a method that can be called to add health to the player, this will be in future sprints where powerups that increase player health are implemented into the game.
Additional Features
There are three additional features that have been implemented with the player health system, including the player treat animations, player notifications, and player loss of health animations.
- Player Treat Animations: For the purpose of when the player picks up or consumes a powerup that potentially restores health, this animation will activate on the screen to provide the player with positive feedback in relation to the occurring action.
- Player Notifications: For the purpose of when the player loses a heart, being aware of when health decreases is important, this notification will pop up on the screen so that the user becomes aware of their deteriorating health, this also adds to the emotional aspect of rising tension.
- Player loss of health animations: For the purpose of when the player loses a heart, this animation will be triggered at the same time as the notification of lost health, but above the head of the player. This provides more animation to the player, and makes the game look less static, and more dynamic.
These features have been implemented for the intention of making the game as obvious as possible for when player health is affected. Without effective animations the player would not know if their health was deteriorating, and by how much. Additionally, these animations make the game more immersive by providing multiple forms of positive and negative feedback.
Design Iterations
Before settling on the final design of the heart system, multiple iterations were drawn up and were eventually refined into the final version of the heart system that was implemented into the game.
Initially the heart system was to be one colour, red, with a simple bar that went down gradually as the player lost health.
The first iteration of the heart system involved changing the red bar to a three heart health system, where the system would contain 3 hearts equal to 3 health.
The final iteration involved changing the health system into a three coloured heart/bar system, where each colour represents 1 health/1 heart.
The prospect of including a unicorn on the health system was discussed, but was decided a heart image would provide more clarity and would match the game theme better.
User Testing
User Tests were conducted on users in order to gain insights on how the health system could become more interactive, also seeking advice on how the game could be laid out better, or how aesthetics could be improved in the game.
One good piece of feedback was a user recommended to have some sort of feedback indicating that the player had lost health (I.e a widget above the players head), as they explained it would look better this way. We took this feedback on board and implemented what is now the animation for player loss of health.
Additionally, the user also provided some recommendations for future sprints, things such as making the player flash (like in super Mario) when they are hit by an enemy or when a power up is activated, or even making the health bar pulsate/flash when health is low.
Finally, the user stated that the art style was inconsistent, so ensuring that all components of the game are consistent in art style would make the game much better aesthetically (I.e. implementing pixelated art style for all components, including the player and enemies).