Code Documentation - GeoYS/game1 GitHub Wiki

Current Directory Structure

  • All the client code is in client in the root directory.
  • All test related code in in tests in the root directory.
  • The remaining code in the root directory is server/node code

Client

Code is split into states. The states transition as as follows: init -> load-assets -> login -> lobby -> pregame -> ingame

Server

Client interface defined in server.js. Interface calls route the client requests to the manager objects (i.e. GameManager, LobbyManager, UserManager). These in turn digest the request and return relevant information to the client.

GameManager contains a collection of Game objects, which in turn contain a collection of Entities. GameManager generally routes client requests to the appropriate game.

The Entity object is meant to be extended to create different kinds of in-game things.

The main areas in server code where in-game design concepts should be implemented:

  1. Extensions of the Entity object
  2. Logic in Game object functions getUserSnapshot and applyAction