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.
- Create a directory with your name, for example
lennard
. - Create a
routes.ts
inside your directory. - Export a
router
object from the theroutes.ts
. - Open
routes.ts
in the root of the project and add arouter.use(...)
to your router accordingly. - Create a
controllers/[Name]Controller.ts
, for exampleLennardController
. - 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.