Implement a GameObject (Room, Item or Character).¶
Refer to the StartupRoom.ts in the backend for an example.
- Create a class with the name
[Name][Type], for example:DungeonRoomorEvilCharacter. - Extend the class from
Room,ItemorCharacter. -
Implement the required abstract functions. Regardless of type, all game objects need:
- A public static readonly
Aliasattribute with an unique alias. - This alias has to be provided through an empty constructor.
- A
namefunction to return the name of the game object.
- A public static readonly
-
Register the game object in the constructor of the
GameServiceusingthis.registerGameObject, for examplethis.registerGameObject(DungeonRoom)orthis.registerGameObject(EvilCharacter).