You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Proposed gameplay flow:
At any time after entering the lobby, a user may make a selection through the UI which would send a websocket message to the server like
cable.perform('select_team',payload)// where payload is an object like{team: "red"// "red" || "blue"}
or
cable.perform('select_role',payload)// where payload is an object like{role: "spy"// "spy" || "intel"}
Keeping these as distinct actions allows for users to assign themselves to a team without selecting a particular role, or to select a role without caring which team they're on.
If that team/role is available, the server would set it for the given Player and respond with a broadcast to all players indicating the updated info. (The player-joined message would also need to be updated to include the extra team/role metadata.)
{type: "player-update",data: {id: 0,name: "name",isBlueTeam: true,// boolean or nullisIntel: true,// boolean or nullplayerRoster: [{id: 0,name: "name",isBlueTeam: true,isIntel: true},
...
]}}
All selections would need to be made before starting the game. This would also mean that we'd want to postpone "establishing" the game and sending the game-setup message until all players have had a chance to make selections. @SiimonStark suggested having a countdown timer in the UI once all players have joined, which I think is a good idea.
Once the timer hits zero, the UI can send a separate message to request that the game start, at which point the server would run the appropriate logic to assign any players who had not selected their roles. This would be followed by the game-start broadcast, and then play would continue as usual.
Requesting feedback from @code-words/back-end @code-words/front-end on this, as it is a significant change to how the game setup flow works.
No description provided.
The text was updated successfully, but these errors were encountered: