-
Notifications
You must be signed in to change notification settings - Fork 0
Pause
The in-game pause menu allows the player to pause the game and resume it at a later time, while also providing other options such as restarting the level or returning to main menu.
-
PauseGameDisplay
Creates the visualisation of the pause menu -
PauseWinAction
Handles the actions taken when the pause button is pressed -
PopupMenuActions
Handles actions after pressing buttons that are common across all pop up menus -
PauseMenuPopup
Triggers the pop up menus based on the status of the game -
GdxGame
Used to set and keep track of the game state
The game has been divided into three different states, with setter and getter methods being added into the GdxGame
class allowing any classes that have the game
passed as a constructor to access and alter the game's state.
public enum GameState {
RUNNING, PAUSED, OVER
}
public void setState(GameState gameState) {
this.gameState = gameState;
}
public GameState getState() {
return this.gameState;
}
The game is paused by checking the current game state. The update()
functions in the render
function of MainGameScreen
will only be called if the state is GdxGame.GameState.RUNNING
:
if (game.getState() == GdxGame.GameState.RUNNING) {
physicsEngine.update();
ServiceLocator.getEntityService().update();
}
Furthermore, if an action triggers the game to pause or resume, the game state is updated:
public void onPause() {
logger.info("pausing game");
if (game.getState() == GdxGame.GameState.RUNNING) {
game.setState(GdxGame.GameState.PAUSED);
}
}
public void onResume() {
logger.info("resuming game");
if (game.getState() == GdxGame.GameState.PAUSED) {
game.setState(GdxGame.GameState.RUNNING);
}
}
Add the pause menu functionality to the game by adding it to the createUI
method in MainGameScreen
:
Entity ui = new Entity();
ui.addComponent(new ...) // Other entities for the UI
.addComponent(new PauseGamePopUp(this.game, new PopupUIHandler(pauseMenuTextures)))
- 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