Game engine - ManuBernard/ThreejsStoryGame GitHub Wiki
Key concepts
Stages
The game is split into stages. The player will navigate in those stage and will discover the story. Each stage contains a field, a camera (that follows the player) and can have one or many doors.
Doors
A door is a way to travel from a stage to another. When the player hits a door, it calls a place loader with 2 parameters :
- from (the name of the current stage)
- to (the destination stage)
Spawns
A spawn is a place in the stage (often near a door), where the player can appear when the stage is loaded. A stage can has many spawns, and to know what spawn to use, the stage looks where the player is coming (the from parameter provided by the door).
The progression object
This is a big object storing all the user progression (key items, game status...). Basicly a big JSON object where we will be able to store everything (has done this action, have visited this screen, has talked to this NPC....)
Stage loaders
Place loaders are triggered by doors. Every time the user hits a door, it triggers the place loader with the from & to parameter.
The to parameter provide the scene to load. The from parameter tells what spawn to use.
The place loader reads the progression object, and will conditionally load things based on what is available.
There will be probably a game loader per stage, so we can use all the power of JS to write conditions and will not be limitated to a JSON object.