-
Notifications
You must be signed in to change notification settings - Fork 172
Game: Temporary page
Manager Type: Special
Process all actions given the list of action Ids, which means execute the actions corresponding to the ID's if their conditional is satisfied.
Game Loop Methods | Description | Usage |
---|---|---|
fastForwardGameActions |
Executes all actions in order of action ids. | Called by GameManager at the start to replay all State-Change that occurred when student last played this game. |
processGameActions |
Executes all actions if the condition to execute them is satisfied, and saves the game afterwards. | Called by GameManager to play Game Start Actions, Checkpoint Complete Actions, and Location Actions; called by Dialogue Manager to play in-dialogue actions; and called by Explore mode to have Object/ Bounding Box actions. |
Helper Methods | ||
processGameAction |
Executes 1 action if the condition to execute them is satisfied. | Called by processGameActions repeatedly to process all actions |
checkCanPlayAction |
Determines whether an action can play. Firstly, the action conditions have to all be satisfied. Secondly, the action has to be either triggered for the first time, or a repeatable action | Called by processGameAction
|
Condition Methods | ||
checkAllConditionsSatisfied |
Checks all the condition objects if each condition is satisfied | Called by checkCanPlayAction
|
checkConditionSatisfied |
Checks whether 1 condition is satisfied. If the condition is on userstate, then it can be stubbed by story writers. If the condition is on game state, then we look into the Checkpoint Objectives to see if they are satisfied. | Called by ActionConditionChecker.checkAllConditionsSatisfied repeatedly to check if all conditions are satisfied |
Execute Action Methods | ||
executeGameAction |
Plays 1 action by checking the action type to call the correct manager and passing in the action params | Called by fastForwardGameActions and processGameActions
|
Manager Type: IGameUI
Given the Awards Mapping from Source Academy Game's Award Mapping object, and the list of awards obtained from User State Manager, be able to render the award, the keys, and the descriptions of each award.
Manager Type: Layer Renderer
Render the background in a Game Location onto Background Layer as specified by assetKey of the Location in State Manager's game map
Game Loop Methods | Description | Usage |
---|---|---|
renderBackgroundLayerContainer |
Obtains all asset key for a location and renders background image on entire screen | Called by GameManager on location render, and on change_background action |
Helper Methods | ||
renderBackgroundImage |
Render background image based on asset given key | Called by renderBackgroundLayerContainer to render GameLocation's background image |
Manager Type: Layer Renderer, State Observer
Render all rectangular bounding boxes in a Game Location onto the BBox Layer as specified by BBoxProperty in State Manager's game map
Property Name | Description | Rationale |
---|---|---|
bboxes |
Mapping between bbox ID and activatable bounding boxes that are present on screen right now. | Indexed by bbox ID so that when updates need to be called on certain bboxes, we can easily rerender/remove this bounding box from screen. |
Game Loop Methods | Description | Usage |
---|---|---|
renderBBoxLayerContainer |
Obtains all bbox IDs present in a Game Location and renders each bbox based on BBoxProperty specification | Called by GameManager on location render. |
Helper Methods | ||
createBBox |
Render 1 rectangular bbox by its bbox id specifications provided by BBoxProperty | Called by renderBBoxLayerContainer repeatedly to render all bboxes individually |
State Observer Methods | ||
handleAdd |
Renders 1 bbox | Called by State Manager on add_item action |
handleDelete |
Deletes 1 on-screen bbox sprite | Called by State Manager on remove_item action |
handleMutate |
Replaces 1 on-screen bbox sprite with the same character with another property | Called by State Manager on setBBoxProperty action |
Manager Type: Layer Renderer, State Observer
Render all characters in a Game Location onto the Character Layer as specified by Character object in State Manager's game map
Property Name | Description | Rationale |
---|---|---|
characterSpriteMap |
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 Game Location and renders each character based on Character specification | Called by GameManager on location render. |
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 id but with another property | Called by State Manager on move_character and update_character action |
Manager Type: Special
Renders dialogues as specified by Dialogue object retrieved from State Manager's game map
Properties
Property Name | 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 |
Manager Type: IGameUI
- 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.
Manager Type: Scene Manager
- Registers all keyboard and mouse event listeners, so that they can be deleted at the end of every scene.
Manager Type: Scene Manager
Keeps a default ordering of layers (e.g Background > ... > Objects > BBox > Characters > ... Effects), and corresponding Phaser Container for each layer. This enables other managers to add game objects to their desired layer.
Properties
Property Name | Description | Usage |
---|---|---|
layers |
Mapping between layer name and layer container | We store layers by ID so that other managers can easily put game objects to chosen layer |
Game Loop Methods | Description | Usage |
---|---|---|
addToLayer |
Adds a game object to a specific layer specified by layer name. | Called by many managers to add desired object into specific layer by name. |
clearLayerContents |
Clears all game objects in 1 layer | Called by many managers to clear a layer so that they can add new game objects to that layer. |
clearSeveralLayers |
Clears all game objects in several layer | Called by managers to clear several layers at once |
clearSeveralLayers |
Clears all game objects in all layers | Used to cleanup the scene |
Extra Methods | ||
fadeInLayer |
Fades a layer in | |
fadeOutLayer |
Fades a layer out | |
showLayer |
Makes layer visible | |
hideLayer |
Makes layer invisible |
Manager Type: Layer Renderer, State Observer
Render all sprites of objects in a Game Location onto the Objects Layer as specified by ObjectProperty in State Manager's game map
Property Name | Description | Rationale |
---|---|---|
objects |
Mapping between object ID and activatable objects that are present on screen right now. | Indexed by object ID so that when updates need to be called on certain objects, we can easily rerender/remove this object from screen. |
Game Loop Methods | Description | Usage |
---|---|---|
renderObjectsLayerContainer |
Obtains all object IDs present in a Game Location and renders each object based on ObjectProperty specification | Called by GameManager on location render. |
Helper Methods | ||
createObject |
Render 1 object image sprite by its object id ObjectProperty. | Called by renderObjectsLayerContainer repeatedly to render all objects individually |
State Observer Methods | ||
handleAdd |
Renders 1 object | Called by State Manager on add_item action |
handleDelete |
Deletes 1 on-screen object sprite | Called by State Manager on remove_item action |
handleMutate |
Replaces 1 on-screen object sprite with another property | Called by State Manager on setObjProperty action |
Action Methods | ||
makeObjectGlow |
Makes one object glow by calling the Glowing Image's glow functions, which makes a yellow tint overlay blink |
Called on make_object_glow action |
makeObjectBlink |
Makes one object blink by calling the Glowing Image's blink functions, which makes the image blink |
Called on make_object_blink action |
Manager Type: Scene Manager
- Performs state transitions by activating and deactivating modes
- Keeps track of history of previous active states using a stack.
Manager Type: Layer Renderer
- Renders popups for a specified amount of time
- Performs actions(s): add_popup
Manager Type: Global
- 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
Manager Type: Global
- 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
Manager Type: 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
Manager Type: 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