Skip to content

View: game

tmorris42 edited this page Jun 14, 2022 · 2 revisions

Components

Game Window

  • input: game controls from keyboard/mouse (if User is Player)
  • canvas/display: game state

New Game Window

  • select desired gameplay options
    • original / power-ups / map / etc
  • start game options:
    • request random/matchmaking opponent
    • challenge User

Game List

  • list: ongoing games
    • option: spectate

Routes Needed

Http

  • GET /matches/: get ongoing matches

Ws

Emit

  • game-challenge-random, { options: <gameOptions> }: request a game with a random opponent
  • game-challenge-user, { user: <userId: number>, options: <gameOptions> }: request a game with a random opponent
  • game-challenge-cancel: cancel the issued challenge/request
  • game-move: action taken by the user during a match (e.g. Move Paddle, User Power-up, etc)

Listen

  • game-challenge-received: when a challenge has been issued to the User
  • game-challenge-accepted: when a challenge was accepted and a match is starting
  • game-state: the current state of the game being played or spectated by the User
  • game-event: special events (e.g. Opponent Disconnected, Game Paused, Challenge Timed Out, etc)

Clone this wiki locally