Methods
(static) generate(gameId, floorIdx, opts)
Generate a new floor (runs on the server and the browser)
Parameters:
Name | Type | Description |
---|---|---|
gameId |
The game id for the game we want to generate | |
floorIdx |
The index of floor we want to generate | |
opts |
object | The options of the specific generators |
- Source:
(async, static) load(gameId, floorIdx)
Load everything on the server
Parameters:
Name | Type | Description |
---|---|---|
gameId |
The game id for the game we want to load | |
floorIdx |
The index of floor we want to load |
- Source:
(async) deleteGame()
Delete a game
- Source:
generateMonster()
Geneate a new monster and place it in the floor
- Source:
generateMonsters(floor)
Puts a monster in half of all "rooms".
Parameters:
Name | Type | Description |
---|---|---|
floor |
Floor | The floor to add monsters to |
- Source:
save(create)
Save the floor (server side)
Parameters:
Name | Type | Description |
---|---|---|
create |
boolean | Create new rows (first save only) |
- Source:
sendState(io)
Send the current state of the floor to the client
Parameters:
Name | Type | Description |
---|---|---|
io |
The socket io boradcast instance for this game |
- Source:
tick(deltaTime)
Moves all monsters and checks for collisions (also anything else that happens every turn)
Parameters:
Name | Type | Description |
---|---|---|
deltaTime |
number | The time that has ellasped since the last tick |
- Source: