Skip to content

Game Model

Tripp312 edited this page Apr 12, 2022 · 29 revisions

World

The singleton that holds all levels in the game model

Variables:

  • campaign: holds all levels to be played
  • currentLevel: index of the current level in the campaign
  • difficulty: integer equivalent of the selected difficulty
  • world: private static variable of the world
  • observer: Screenobserver used to update the view on every timer tick

Methods:

  • reset(): creates a new instance of world
  • instance(): calls the current instance of world
  • World(): constructor
  • passLevel(): increases currentLevel by one and moves the player accordingly
  • getCurrentEntities(): obtains all entities on the current screen
  • getCurrentLevel(): returns currentLevel in the campaign
  • getPlayer(): returns the current instance of player
  • populate(): creates the base gameState without the level builder
  • updater(): contains the timer that prompts all movement in the game
  • update(): called by updater, calls all on-screen entities' performMovement() method
  • save(): saves the current state of the game
  • load(): loads the saved state of the game

Level

Variables:

Clone this wiki locally