Skip to content

Client Module Level Overview

Subtlemon edited this page Apr 26, 2019 · 9 revisions

Component Tree Overview

Component Level Overview

App.js

Main component of the React App.

Responsibilities

Direct Children

RoomComponent.js

Waiting lobby.

Responsibilities

  • Renders GUI for users with presence in room.
  • Renders GUI for shared game settings.
  • Writes game settings to trigger game start in App.js.

GameComponent.js

Game Manager.

Responsibilities

  • Establishes user presence under activePlayers.
  • Establishes listener to progress state (change chains) when no players have presence as notReady.
  • Renders one of its direct children based on current state.

Direct Children

StartComponent.js

Start a chalk chain.

Responsibilities

  • Renders GUI for user inputted initial word/phrase.
  • Establishes user presence under notReady until ready.
  • Pushes new chain into chains in game in Firebase.

DrawComponent.js

Add a drawing to the current chain.

Responsibilities

  • Renders GUI for users to draw the latest word/phrase in the current chain.
  • Establishes user presence under notReady until ready.
  • Add the new image to the current chain.

GuessComponent.js

Add a guess to the current chain.

Responsibilities

  • Renders GUI for users to guess the latest image in the current chain.
  • Establishes user presence under notReady until ready.
  • Add the word/phrase to the current chain.

SpectateComponent.js

View game results.

Responsibilities

  • Renders GUI to view entire chain at a time.
  • Establishes listener to share current chain view with other players.
  • Moves back to RoomComponent.js via callback.
Clone this wiki locally