From 0c191fb691576473457b4cf8844ce29a4f708634 Mon Sep 17 00:00:00 2001 From: Peter Hart Date: Sat, 2 May 2020 20:54:38 -0400 Subject: [PATCH] add initial design notes --- DESIGN.org | 218 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 218 insertions(+) create mode 100644 DESIGN.org diff --git a/DESIGN.org b/DESIGN.org new file mode 100644 index 0000000..7d7b7a7 --- /dev/null +++ b/DESIGN.org @@ -0,0 +1,218 @@ +#+TITLE: Design Notes + +* Messages + +** State Update + +*** Start Game State +#+BEGIN_SRC json +{ + "state": "BEGIN_GAME", + "players": {"name":{},"name2":{}} +} +#+END_SRC + +*** Ready To Play + +#+BEGIN_SRC json +{ + "state":"READY_TO_PLAY", + "players": {"name":{},"name2":{}} +} +#+END_SRC + +*** Text Prompting + +#+BEGIN_SRC json +{ + "state":"TEXT_PROMPT", + "players": {"name":{"complete": false},"name2":{"complete":true}}, + "initialPromptId":"id goes here", + "answerId":"", + "prompt": "text prompt here" +} +#+END_SRC + +*** Drawing Prompting + +#+BEGIN_SRC json +{ + "state":"IMAGE_PROMPT", + "players": {"name":{"complete": false},"name2":{"complete":true}}, + "initialPromptId":"id goes here", + "answerId":"", + "url": "image.png" +} +#+END_SRC + +*** Showing Prompts + +#+BEGIN_SRC json +{ + "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":""} +} +#+END_SRC + +** Client Actions + +*** Join Game + +#+BEGIN_SRC json +{ + "action":"JOIN", + "playerName":"name" +} +#+END_SRC + +*** Start Game + +Person who starts the game is the 'leader' + +#+BEGIN_SRC json +{ + "action":"START", + "player":"name" +} +#+END_SRC + +*** Reconnect As Player + +Allows reconnnection of a previously connected player. + +#+BEGIN_SRC json +{ + "action":"RECONNECT", + "playerName":"name" +} +#+END_SRC + +*** Reconnect As Player + +Allows reconnnection of a previously connected player. + +#+BEGIN_SRC json +{ + "action":"RECONNECT", + "playerName":"name" +} +#+END_SRC + +*** 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) + +#+BEGIN_SRC json +{ + "action":"RECONNECT", + "playerName":"name" +} +#+END_SRC + +*** Drop a Player + +Drops a disconnected player from the game (permanently), leader only. + +#+BEGIN_SRC json +{ + "action":"DROP_PLAYER", + "player":"name" +} +#+END_SRC + +*** Text Prompt Answer + +#+BEGIN_SRC json +{ + "action":"TEXT_PROMPT_ANSWER", + "player":"name", + "imageData":"data:image/png;base64,..." +} +#+END_SRC + +*** Image Prompt Answer + +#+BEGIN_SRC json +{ + "action":"IMAGE_PROMPT_ANSWER", + "player":"name", + "text":"answer text here" +} +#+END_SRC + +*** 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. + +#+BEGIN_SRC json +{ + "action":"SKIP_PLAYER", + "player":"name" +} +#+END_SRC + +*** Show Next Answer + +#+BEGIN_SRC json +{ + "action":"NEXT_ANSWER", + "player":"name" +} +#+END_SRC + + +*** Show Previous Answer + +#+BEGIN_SRC json +{ + "action":"PREVIOUS_ANSWER", + "player":"name" +} +#+END_SRC + +*** 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. + +#+BEGIN_SRC json +{ + "action":"REACT", + "reaction":"LIKE", + "initialPromptId":"", + "answerId":"", + "player":"name" +} +#+END_SRC + +*** Next Player + +#+BEGIN_SRC json +{ + "action":"NEXT_PLAYER", + "player":"name" +} +#+END_SRC \ No newline at end of file