Home.md - rogue-wavelength/rogue-wavelength GitHub Wiki
Welcome to the rogue-wavelength wiki!
Data flow
/**
* DATA FLOW
* PRE-GAME
* client.emit "joinRoom" {roomCode, Name} => Server
* Server takes and assigns person to room
* Server Emits "roomPopulate" to people in that room the new list of persons in room
* client.emit "joinTeam" {roomCode,name,teamName} => Server
* Server takes and assigns person to team, emits new team state to everyone in room
* (this happens in the party component)
*
* GAME
* Button GAME START
* client.emit "startGame" or something {roomCode} => Server
* Server sets first card and TeamA to playing,
* Server emits "waiting" + payload (card and target) to everyone, that says TeamA playing, TeamB waiting,
* and who the
* psychic is, psychic gets reveal priveleges for card and target (done on the front end)
* psychic takes time to think of input + submits clue
* client.emit "submitClue" {roomCode,clue} => Server
* Server takes clue and broadcasts it to everyone else in the room Server.emit "showClue" {clue}
* client.emit "revealCard" {roomCode} => Server // done by the psychic
* Server sets card to visible for rest of players
* server.emit "revealCard" // 'flipping' the card from psychic
* server sends clue and card to all players
* server sends props to psychic so they can see what other players are seeing
* now players are allowed to control slider
*
* players submit their guess:
* client.emit "guess"
* guess is saved on server redux, then server
* will send props to allow opposing team to guess
* server.emit "guessLockedIn"
* opposing team now allowed to guess
*
* then they will submit their higher/lower guess
* client.emit "opponentGuess"
* server calculates score and then emits
* server.emit "result"
* card, target, clue revealed; score calculatd
* score updated on front end and back end
* players can click to proceed with game
* client.emit "newTurn"
* card, target, clue cleared out
* score is maintained
* new psychic is chosen
*/