Skip to content

Add your own directory with game objects and other logic

Depending on the size of the game, it can become increasingly more important to use other directories than just the game-implementation. This is however fully optional.

Refer to the game-implementation/routes.ts in the backend for an example.

  1. Create a directory with your name, for example lennard.
  2. Create a routes.ts inside your directory.
  3. Export a router object from the the routes.ts.
  4. Open routes.ts in the root of the project and add a router.use(...) to your router accordingly.
  5. Create a controllers/[Name]Controller.ts, for example LennardController.
  6. Add the required functions for your API endpoints and add them to your routes.ts.

Use your directory to create a structure with rooms, items, characters, actions and actionResults. Don’t forget to register your game objects and actions in the GameService, use comments to separate your game objects/actions from others.