Open MrEliptik opened 1 year ago
We can put a game_state.md
inside the game directory to document the state flow we want. This works on GitHub and any editor that has an mermaid plugin.
Link: mermaid
Here is an not fully implemented example:
---
title: GAME_STATE
---
stateDiagram-v2
WAITING
note right of WAITING
players !join
end note
RUNNING
note left of RUNNING
players !fire deg power
end note
WINNER : WINNER *
PAUSED : PAUSED *
[*] --> WAITING
WAITING --> RUNNING : 'admin !start'
RUNNING --> WINNER : one player left
WINNER --> RUNNING : 'admin !restart'
*
not implemented yet
This looks like a good solution!
Maybe we can define the loop for this game in a stream. There we just draw a picture. And then someone (me) could transform it to a mermaid diagram. At the moment I don`t know exactly what flow you have in mind.
Here are the states I'd like to have 👇
The game will start a new one after the winner state.
This command should be handles trough a admin / streamer
script
!start <seconds)
will change state to WAITING
and will transition to RUNNING
after <seconds>
!reset
will reset game and switch to WAITING
also all viewers have to !join
again!wait
will switch to WAITING
without changing viewer state (active
, waiting
, dead
)This commands are handles trough the viewers.gd
autoload
!join
will join the game depending on the current game state!leave
will leave the gameThis commands are handled trough the game
itself
!fire <angle> <power>
will shot viewer into the given directionstateDiagram-v2
(game_start) --> PAUSED
PAUSED --> WAITING: !start auto <seconds>
WAITING --> RUNNING: after <seconds> seconds
RUNNING --> WINNER: when one viewer is left
WINNER --> WAITING: after <seconds> seconds
!join
!start auto <seconds>
stateDiagram-v2
(game_start) --> PAUSED
PAUSED --> WAITING: !start auto <seconds>
!join
waiting list
and dead list
viewers will be add to the active list
stateDiagram-v2
PAUSED --> WAITING
!wait --> WAITING
!reset --> WAITING
WAITING --> RUNNING: after <seconds> seconds
!join
but will be add to the wait list
dead list
stateDiagram-v2
RUNNING --> WINNER : when one viewer is left
!join
but will be add to the wait list
stateDiagram-v2
WINNER --> WAITING : after <seconds> seconds
autorun
vs once
looprandom
loop@MrEliptik Tried to translate the first picture into diagrams and some text :D
Define the game loop(s) that we want. A flowchart can help visualize.
Also think about the different ways to start a game: after a countdown, after X players joined, on streamer command, etc...