Skip to content

Main Game Screen and Main Game Display

Ahmad Abu-Aysha edited this page Oct 15, 2023 · 3 revisions

Introduction

Once the player has navigated through all the pre-game screens (story, level select, turret select), the game screen switches to the MainGameScreen class, which contains all the in-game elements which the player sees, hears and interacts with. The MainGameScreen is the container and controlling class for all the services, determines the level-specific assets to use for the game environment, and contains the render() function for rendering the game content to screen.

UI

The ui is attached to an entity instantiated in createUI(). The main components htat are added (among others) are:

  • MainGameActions - contains event listeners for exit state, lose state and win state.
  • InputDecorator - handles and propagates inputs on the main game stage
  • MainGameDisplay - Contains all interactive UI buttons, and their behaviour handling. (At this stage, the Pause button and the tower build menu.)

Assets

In-game background visual and audio assets are loaded via loadAssets(). Any additional background assets that need to be added to the game need to be added in this class, by adding the paths the class variables and then ensuring that the assets are included in the loadAssets() function.

Clone this wiki locally