3.5 KiB
Design Notes
Messages
State Update
Start Game State
{
"state": "BEGIN_GAME",
"players": {"name":{},"name2":{}}
}
Ready To Play
{
"state":"READY_TO_PLAY",
"players": {"name":{},"name2":{}}
}
Text Prompting
{
"state":"TEXT_PROMPT",
"players": {"name":{"complete": false},"name2":{"complete":true}},
"initialPromptId":"id goes here",
"answerId":"",
"prompt": "text prompt here"
}
Drawing Prompting
{
"state":"IMAGE_PROMPT",
"players": {"name":{"complete": false},"name2":{"complete":true}},
"initialPromptId":"id goes here",
"answerId":"",
"url": "image.png"
}
Showing Prompts
{
"state":"RESULTS",
"initialPlayer":"name",
"initialPrompt":"text prompt",
"player":"name",
"type":"image|text",
"text": "text goes here",
"url":"image.png",
"initialPromptId":"id goes here",
"answerId":"",
"reactions":{"name":""}
}
Client Actions
Join Game
{
"action":"JOIN",
"playerName":"name"
}
Start Game
Person who starts the game is the 'leader'
{
"action":"START",
"player":"name"
}
Reconnect As Player
Allows reconnnection of a previously connected player.
{
"action":"RECONNECT",
"playerName":"name"
}
Reconnect As Player
Allows reconnnection of a previously connected player.
{
"action":"RECONNECT",
"playerName":"name"
}
Disconnect a player
This is hopefully detected automatically, and the game will just automatically remove them from play for the next round, and treat them as skippable in this game.
Reconnect As Player
Allows reconnnection of a previously connected player (who has not been dropped)
{
"action":"RECONNECT",
"playerName":"name"
}
Drop a Player
Drops a disconnected player from the game (permanently), leader only.
{
"action":"DROP_PLAYER",
"player":"name"
}
Text Prompt Answer
{
"action":"TEXT_PROMPT_ANSWER",
"player":"name",
"imageData":"data:image/png;base64,..."
}
Image Prompt Answer
{
"action":"IMAGE_PROMPT_ANSWER",
"player":"name",
"text":"answer text here"
}
Skip Player
If a player has disconnected, they can be skipped in this round, and the next player will get their prompt, and once they've completed it, we'll continue the game as before. Can only be sent by current leader.
{
"action":"SKIP_PLAYER",
"player":"name"
}
Show Next Answer
{
"action":"NEXT_ANSWER",
"player":"name"
}
Show Previous Answer
{
"action":"PREVIOUS_ANSWER",
"player":"name"
}
Reaction To Answer
-
possible reactions are:
- Like
- LOL
- Thumbs Down
- Man Facepalming
- Woman Facepalming
points gained for most Likes, most LOLs, most negative reactions (thumbs down/facepalm), and most reactions
You cannot react to your own response to a prompt, each player can only have one reaction to any given answer.
{
"action":"REACT",
"reaction":"LIKE",
"initialPromptId":"",
"answerId":"",
"player":"name"
}
Next Player
{
"action":"NEXT_PLAYER",
"player":"name"
}