-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDESIGN
68 lines (46 loc) · 2.18 KB
/
DESIGN
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
- Room is created
- - Start game, return game ID to client
- Players join
- - Player browser knows game type
- - Send PLAYER JOINED event w/ player information
Shoot The Messenger
- - Players start listening on stm.PlayerStream
- Apple TV starts game
- Call stm.BeginGame
- Receive prompts
- Players receive prompts from PlayerStream
- A user is selected as guesser
- - Server assigns guesser, sends PlayerFrame w/ who is guesser
- - Server sends PlayerFrame with GameState 'RESPONDING'
- Server sends PromptResponseInputFrame to everyone + apple tv
- A prompt is shown on apple TV
- - Apple TV sends PromptResponseInputFrame
TO SERVER
- - Server sends PromptResponseInputFrame to ALL PLAYERS
- Game shows if user has answered
- - Send PromptResponseFrame to Apple TV
- After each player has answered, server checks if all players did answer
- Send RoleFrame to guesser + Apple TV
- When Apple TV receives GameState = 'READING', begin reading sequence
- When guesser receives RoleFrame (with guesser ID) and GameState = 'READING', begin reading sequence
- - Receives all responses in AllResponsesFrame
- Guesser browser displays one response at a time
- - Sends response displayed to Apple TV via ReadResponseFrame
- Guesser continues swiping through responses
- - Sends response displayed to Apple TV via ReadResponseFrame
- Once all responeses swiped through, show new interface on browser and apple tv
- - Server sends GameState = 'GUESSING' to Apple TV and all clients
- Guesser guesses who responded to what
- - Send GuessFrame to server
- - server verifies guess
- If guess is right, show UI on apple TV. User who was guessed is out, award point to guesser
- - Send ADD POINT event for guesser
- - (TODO: implement points)
- If guess is wrong, show UI on apple TV, new user becomes guesser, continues guessing current set of responses
- - Send RoleFrame with original guesser out
- - Send RoleFrame with new guesser ID
- - Send AllResponsesFrame with remaining responses
- If all guesses are correct, game / round is over. Display current score
- - Send GameState = 'RESULTS' + current score
- If all users are failures, game / round is over. Display current score
- - Send END ROUND + current score