Skip to content

Game: Temporary page

Tiffany Chong edited this page Jul 28, 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

Description

Render all characters in a specific location onto the Character Layer as specified by Character object in State Manager's game map

Variables Description Rationale
characterSpriteMap A map which mapping between character ID and sprites of Characters that are present on screen right now. Indexed 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 Usage
renderCharacterLayerContainer Obtains all character IDs present in a location and renders each character based on Character specification Called by GameManager when rendering location to render the entire Character Layer.
Helper Methods
createCharacterSprite(id) Render 1 character by its character id using default expression and position of the character. Called by renderCharacterLayerContainer repeatedly to render all characters individually
createCharacterSprite(id, expression, position) Renders 1 character with a different expression (based on the different asset keys stored in Character data type) and different position (based on Character constants) Called by DialogueSpeakerRenderer to render speaker avatars
State Observer Methods
handleAdd Renders 1 character Called by State Manager on add_item action
handleDelete Deletes 1 on-screen character sprite Called by State Manager on remove_item action
handleMutate Replaces 1 on-screen character sprite with the same character with another property Called by State Manager on move_character and update_character action

Dialogue Manager

Description

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

Variables Description Usage
dialogueGenerator Class which holds a pointer to the current part and line in the Dialogue object, it keeps track of the lines that should play next Called by Dialogue Manager on line change
dialogueRenderer Renderer that displays the green box and flashes text using the typewriter effect Called by Dialogue Manager on line change
speakerRenderer Manager which renders the speaker box speaker avatar Called by Dialogue Manager on line change
Game Loop Methods Description Usage
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
playWholeDialogue Starts a promise to play the entire dialogue. Attaches listener to green dialogue box, so that when clicked, it can show the next line. Main function called by showDialogue
showNextLine Renders one dialogue line, by generating line using dialogueGenerator, rendering the text using dialogueRenderer, changing the speaker using speakerRenderer and processing actions using Action Manager's processActions. If no more lines, it resolves the promise and ends the dialogue. Called by playWholeDialogue on start of dialogue and whenever dialogue box is clicked

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