Replace Gamestate manual changes with gameflow event triggers
Closed this issue · 2 comments
jleung51 commented
The current gamestate manual changes (in the Gamestate controller /gamestate
) should be moved into the Admin controller (see issue #32).
Gameflow Overview
Gameflow will therefore be the following process, which combines admin triggers and game triggers:
- Game initialized or reset (manually triggered by administrative endpoint)
- Game state
INITIALIZING
- All player states
UNINITIALIZED
- All Pacdots
eaten == false
- Game state
- All teams choose their characters, changing them from
UNINITIALIZED
toREADY
- Game state changed from
INITIALIZING
toIN_PROGRESS
(automatically triggered) - All players states changed from
READY
toACTIVE
(automatically triggered) - No change to Pacdots
- Game state changed from
- Pacman eats a Pacdot (i.e. Pacman's location is updated to be near a Pacdot while the game state is
IN_PROGRESS
)- No change to game state
- No change to player states
- The Pacdot within proximity changed to
eaten == true
(automatically triggered)
- Pacman eats a Powerdot (i.e. Pacman's location is updated to be near a Powerdot while the game state is
IN_PROGRESS
)- No change to game state
- Pacman's state changed from
ACTIVE
toPOWERUP
for 30 seconds, then back toACTIVE
(automatically triggered) - The Powerdot within proximity changed to
eaten == true
(automatically triggered)
- Pacman eats all Pacdots and Powerdots
- Game state changed from
IN_PROGRESS
toFINISHED_PACMAN_WIN
(automatically triggered) - No change to player states
- All Pacdots
eaten == true
(required precondition)
- Game state changed from
- Pacman contacts a Ghost while Pacman is in the
ACTIVE
state and the Ghost is in theACTIVE
state (manually and physically tagged)- Game state is changed from
IN_PROGRESS
toFINISHED_GHOSTS_WIN
(manually triggered by administrative endpoint) - The Pacman's state is changed from
ACTIVE
toCAPTURED
(manually triggered by administrative endpoint) - No change to Pacdots
- Game state is changed from
- Pacman contacts a Ghost while Pacman is in the
POWERUP
state and the Ghost is in theACTIVE
state (manually and physically tagged)- No change to game state
- The Ghost's state is changed from
ACTIVE
toCAPTURED
(manually triggered by administrative endpoint) - No change to Pacdots
I will add the above overview to the wiki when the issue is complete.
@pacmacro/android and @pacmacro/ios, if I have made a mistake in this gameflow, please let me know.
jleung51 commented
Proposed API documentation changes:
API Documentation for Game State
All of the following:
Mapping
/gamestate
changed to:
Mapping
/admin/gamestate
jleung51 commented
Completed in the above-referenced merge commit.
The wiki has been updated with the above documentation.
For any changes or discussion, please open a new issue.