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:DungeonRoom
orEvilCharacter
. - Extend the class from
Room
,Item
orCharacter
. -
Implement the required abstract functions. Regardless of type, all game objects need:
- A public static readonly
Alias
attribute with an unique alias. - This alias has to be provided through an empty constructor.
- A
name
function to return the name of the game object.
- A public static readonly
-
Register the game object in the constructor of the
GameService
usingthis.registerGameObject
, for examplethis.registerGameObject(DungeonRoom)
orthis.registerGameObject(EvilCharacter)
.