FloorGenerator

scalata.application.services.FloorGenerator

Procedural generator that builds one tower floor together with the initial GameSession snapshot for that level.

==== Overview ====

  • Shuffle room names and arrange them in a matrixRooms grid (rows × columns) so the dungeon is always rectangular.
  • Create every Room with random padding so shapes vary between runs.
  • Populate rooms (except the spawn room) with enemies and items whose number scales with difficulty.
  • Insert a Sign in the spawn room and an Exit Door in the last room to let the player advance to the next floor.
  • Return a fully initialised GameSession that already contains one entry in the undo history (GameSession.init).

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Value members

Concrete methods

def generateFloor(player: Player, difficulty: Int, seed: Long, level: Int): GameSession

Create a new floor and wrap it in a GameSession.

Create a new floor and wrap it in a GameSession.

Value parameters

difficulty

global difficulty (1–10) controlling spawn rates

level

tower floor index (starts at 1)

player

hero to place in the starting room

seed

random seed for reproducible layouts

Attributes