Source: Frontend/game/common/floor.mjs

  1. /** @module common/Floor */
  2. import "./game-map/game-map-renderers.mjs";
  3. /**
  4. * The game map, monsters, players and items for this floor
  5. */
  6. class Floor {
  7. /**
  8. * @private
  9. * @param gameId The game id for the current game
  10. * @param floorIdx The index of this floor
  11. */
  12. constructor(gameId, floorIdx) {
  13. this.id = `${gameId}-${floorIdx}`;
  14. // below: ratio of Monsters to Rooms. ex: 0.4 puts monsters in a fourth of the rooms.
  15. this.monsterRatio = 1;
  16. // Initialize players, monsters and the game map in loadBrowser, loadNode, and generate methods
  17. }
  18. /**
  19. * The interval at which we update the game state (if this is too short the server will break)
  20. */
  21. static get UPDATE_INTERVAL() {
  22. return 100;
  23. }
  24. }
  25. export default Floor;