Skip to content

Loss & Win In Game Menus

default-jamc edited this page Aug 26, 2021 · 17 revisions

Purpose

In-Game loss & win menus allow for the player to control the behaviour of the game when they lose or clear a level, giving the player a sense of direction in the game.

Menu Format

Both menus will appear on the screen as floating boxes or 'pop-ups' such that the rest of the game screen will still be visible behind them. Menus will feature buttons which allow the player to choose whether to continue, retry or return to the main menu.

Loss menu

Buttons & Interaction: The Loss menu will feature 2 buttons, 'Replay' and 'Return to Main Menu'. Both buttons will have an associated symbol.

Structure & Design: The menu colour will depend on the colour palette for the rest of the game. The menu will predominantly be a colour which is on the opposite side of the colour wheel to the Level Cleared / Win menu, to indicate their contrast.

Activation: The loss menu will appear when the player's health drops to 0.

Level Cleared / Win menu

Buttons & Interaction: The Level Cleared / Win menu will feature 2 buttons, 'Continue' and 'Return to Main Menu'. Both buttons will have an associated symbol.

Structure & Design: The menu colour will depend on the colour palette for the rest of the game. The menu will predominantly be a colour which is on the opposite side of the colour wheel to the Loss menu, to indicate their contrast.

Activation: The win menu will appear when the player clears the level by reaching the right-most edge of the screen.

Implementation

Currently, the menus are UIComponent's of the MainGameScreen, which are passed a reference to the player (Entity) and game (GdxGame) so that they can keep track of the player state in the game, and make changes to the game accordingly (eg, set the new screen).

In the MainGameScreen's createUI method:

Entity ui = new Entity(); 
ui.addComponent(new ..).addComponent(new PlayerLossPopup(game, player));

The MainGameScreen's constructor was changed to retrieve a reference to the ForestGameArea object, so that it's player Entity can be retrieved:

public MainGameScreen(GdxGame game) {
    ...
    this.currentMap = forestGameArea;
    createUI();
}

And hence a getPlayer method was added to the ForestGameArea class:

public Entity getplayer() {
    return player;
}

Other

We would like to implement meteors / asteroids continually falling from the sky in the background as these menus appear, which gives the game a greater sense of immersion than if the entire screen were to pause when these menus appear.

Table of Contents

Home

Introduction

Main Menu

Main Game Screen

Gameplay

Player Movement

Character Animations

Enemy Monster Design and Animations

Game basic functionalities

User Testing

GitHub Wiki Tutorial

Game Engine

Getting Started

Documentation

Entities and Components

Service Locator

Loading Resources

Logging

Unit Testing

Debug Terminal

Input Handling

UI

Animations

Audio

AI

Physics

Game Screens and Areas

Terrain

Concurrency & Threading

Settings

Troubleshooting

MacOS Setup Guide

Clone this wiki locally