Skip to content

Game: Temporary page

Tiffany Chong edited this page Jul 27, 2020 · 23 revisions

Managers

Action Manager

  • Manages

Awards Manager

  • Renders the Awards Menu which displays assets corresponding to user's collectibles and achievements.
  • Implements Game UI as AwardMenu is one of the possible game phases.

Specification

  • Given the Awards Mapping (from StateManager), and the list of awards obtained (from UserStateManager), be able to render the award, the keys, and the

Background Manager

  • Renders the background image for every location

  • Specification

  • Performs action(s): change_location

Bounding Box Manager

  • Creates, renders, and manages bounding box sprites within every location.
  • Pulls state from State Manager and listens for state changes related to bounding boxes in current location.

Character Manager

Main task: Render characters in a specific location as specified by Character object in State Manager's game map

Variables Description
characterSpriteMap A map which mapping between character ID and sprites of Characters that are present on screen right now. We index by character ID so that when updates need to be called on certain characters, we can easily rerender/remove this character
Game Loop Methods Description
renderCharacterLayerContainer Called by GameManager when rendering location to render the entire Character Layer. It renders each character based on specification,
Helper Methods Description
createCharacterSprite Render 1 character by its character id, together with default expression and position of the character. It can also render the same character, with a different expression (based on the different asset keys stored in Character data type) and different position (based on Character constants)

State Observer methods implemented: handleAdd, handleDelete, handleMutate

Dialogue Manager

Main task: Renders dialogues as specified by Dialogue object retrieved from State Manager's game map

Variables Description
speakerRenderer A small manager which shows the correct name on the speaker box and renders the correct speaker in Speaker Layer
dialogueRenderer A renderer that displays the green box and flashes text using the typewriter effect
dialogueGenerator A little class that holds a pointer to the current part and current line in the Dialogue object, it keeps track of the lines that should play next
Game Loop Methods Description
showDialogue Plays out an entire dialogue, orchestrating the change in speakers, lines and in-dialogue actions. Called in Talk mode and during show_dialogue action.
Helper Methods Description
playWholeDialogue Attaches listener to green dialogue box, so that when clicked, it can show the next line as generated by its dialogueGenerator
showNextLine Shows the line using the DialogueRenderer, shows the speaker using SpeakerRenderer, and Executes the action using Action Manager. If no more line, it resolves the promise and ends the dialogue.

Escape Manager

  • Renders the Escape Menu, which provides options for changing user settings and going back to Main Menu.
  • Implements Game UI as EscapeMenu is one of the possible game phases.

Input Manager

  • Registers all keyboard and mouse event listeners, so that they can be deleted at the end of every scene.

Layer Manager

  • Creates all layers in order specified by defaultLayerSequence.
  • Manages addition of objects into specific layers.
  • Manages visibility and effects for an entire layer.
  • Performs action(s): show_object_layer

Object Manager

  • Creates, renders, and manages character sprites within every location.
  • It pulls state from State Manager and listens for state changes related to objects in current location.
  • Performs action(s): make_object_blink, make_object_glow

Phase Manager

  • Performs state transitions by activating and deactivating modes
  • Keeps track of history of previous active states using a stack.

Pop Up Manager

  • Renders popups for a specified amount of time
  • Performs actions(s): add_popup

Save Manager

  • Loads user data at the start of entire game
  • Saves game data every start of checkpoint and every time a series of actions is performed.
  • Saves settings to backend

Sound Manager

  • Plays and pauses plays background music throughout the game with the volume specified in user settings
  • Plays sound effects with volume specified in user settings

State Manager

  • Manages user progression throughout the game by keeping track of set of triggered interactions, set of triggered state-change actions, and completed objectives
  • Also manages the game map which contains dynamic information about the objects, characters and other entities in each location.
  • Performs actions: add_item, remove_item, add_mode, remove_mode, complete_objective

User State Manager

  • Manages states related to the user, available regardless of which checkpoint he is at.
  • Stores achievements, collectibles, and assessments completed by the user.
  • Performs action(s): obtain_collectible
Clone this wiki locally