-
Notifications
You must be signed in to change notification settings - Fork 29
[game] Developer Documentation
The game
module is wrapper of the Phaser 3 API, that allows users to program their own game rooms in the Source Academy game. Students are able to use the game
module functions inside the Phaser lifecycle functions (preload(), create() and update()), to define the room behaviour they want. Student room code is later fetched and run in-game.
You can check out the module's documentation for more information on each exposed function's specifications.
This is the entry point to the module and contains a single default export that returns the module's exposed functions. It does this by passing GameParams into gameFuncs
in functions.ts.
gameFuncs
in functions.ts contains implementation details for the module's private and public functions, and returns the public ones. TSDoc requires that public functions are exported from functions.ts for documentation to be generated as described here. As a result, dummy functions with the same signature as the module's public functions with the function's documentation need to be exported.
Game module types are defined here and generally wrap Phaser GameObject types that are typically used in similar ways in the module.
-
RawGameElement
: Phaser Sprite or Phaser Text -
RawGameShape
: Phaser Rectangle or Phaser Ellipse -
RawGameObject
: RawGameElement or RawGameShape -
RawContainer
: Phaser Container -
RawInputObject
: Phaser InputPlugin or Phaser Keyboard.Key -
GameObject
: the GameObject's type string, together with a RawGameObject or RawInputObject or RawContainer -
GameParams
: Contains fields that will be passed in from frontend that are required for the module's functions -
__Params
: The module params passed into the module (from frontend) with a GameParams field
The Game Tab currently only displays a reminder for the student to save their work and see the effect of the roomcode in-game, and links to the API documentation and User Guide.
- Home
- Overview
- System Implementation
-
Development Guide
- Getting Started
- Repository Structure
-
Creating a New Module
- Creating a Bundle
- Creating a Tab
- Writing Documentation
- Developer Documentation (TODO)
- Build System
- Source Modules
- FAQs
Try out Source Academy here.
Check out the Source Modules generated API documentation here.