-
Notifications
You must be signed in to change notification settings - Fork 0
Lives System
Like most action-Adventure games, this game will incorporate a life system, giving the player a set amount of tries to overcome certain obstacles before being forced to restart. Giving the player extra lives is a great incentive as death doesn’t mean the end of a game, but they only get to die a certain amount of times before having to restart. Player's will need to be considerate of how they proceed, as the further into a level they go, the more valuable these lives become. There could even be cases where the player might need to play through a section several times to overcome it, and the lives help improve the effect of these difficulties in tandem with the checkpoint system by giving a player a set amount of replays from a certain position in the level.
Different icons were created in order to represent the lives. Since oxygen tanks are going to be used as a buff, the most likely choices will either be the astronaut head silhouette or the heart within the gear
The lives system utilises the health and pop-up menus to determine it's outcome. The player will initially begin with 5 lives. When the player's health reaches 0, the PopUpMenuActions
class will inform the system that the player has died. For this to be considered, a game state was added; RESPAWN, which is invoked when the player has pressed replay after dying.
This functionality begins when Initialisation of this class occurs when ForestGameArea.spawnPlayer() is activated, adding the Lives Component to the player entity components. The constructor for LivesComponent is included below:
public LivesComponent(int lives) {
this.lives = lives;
}
The amount of lives is then displayed clearly on the UI for the player to see. The LivesComponent class activates again once the player has respawned after dying. In PopupMenuActions
, on death the onReplayLoss() method is called, which sets the game to the RESPAWN state if the checkpoint hasn't been reached, and the CHECKPOINT if it has.
public void onReplayLoss() {
if (area.getPlayer().getComponent(LivesComponent.class).getLives() < 1) {
onHome();
} else {
if (area.getCheckPointStatus() == 1) {
game.setScreen(GdxGame.ScreenType.CHECKPOINT);
} else {
game.setScreen(GdxGame.ScreenType.RESPAWN);
}
}
}
This changes the isDead variable in ForestGameArea to true; this thus decrements the global variable for lives by 1, and sets it to the player's LivesComponent component.
if (isDead()) {
lives -= 1;
newPlayer.getComponent(LivesComponent.class).setLives(lives);
} else {
if(lives < 5 && !isDead()) {
lives = 5;
newPlayer.getComponent(LivesComponent.class).setLives(lives);
}
}
public void setLives(int lives) {
this.lives = lives;
if (entity != null) {
entity.getEvents().trigger("updateLives", lives);
}
}
This process will continue whilst the number of lives is 0 or greater. When the player dies on 0 lives, they are sent back to the main menu and forced to start over from the beginning. A fresh set of lives will be given then.
Below is a simple UML Diagram to display the lives component on the MainGameScreen
The lives will be displayed at all times during the game, and is represented by the silhouetted outlines of the astronaut's head.
- Player UI
- Popup Menus
- Obstacles
- Boss Enemies
- Progress Tracker
- Checkpoint Design and Functionality
- Score System
- Lives System
- Game Background
- Multiple game-level
- Visual Improvements
- Tutorial Level
- Character Design and Animations
- Character Damage Animations
- Player Animation Functionalities
- Player and Serpent Portal Transition
- Pop-up Menus
- Obstacles
- Lives & Score User Testing
- Buffs & Debuffs
- Buffs & Debuffs redesign
- Obstacle Animation
- Background Design
- Level 2 Background Appearance
- Enemy Monster User Testing
- Level 1 Floor Terrain Testing
- Introduction Screens User Testing
- Character Movement Interviews & User Testing
- Sound user testing
- Level 2 Obstacles and enemy
- Story, Loading, Level 4 and Win Condition Sound Design User Testing
- Giant Bug and Purple Squid animation user testing
- General Gameplay and Tutorial Level User Testing
- Level 4 Terrain User Testing
- Game Outro User Testing