SlimePlatformer/Levels/Maze/maze_settings.gd
tachyonwolf df89fa4ac7 Maze-book labyrinths, sucking one-way entrances, slime movement model
- Regions are now dense labyrinths (recursive backtracker on a coarse grid,
  1-3 tile corridors, braided loops by complexity); tubes run in the rock
  between regions, wall pipes give shortcuts inside a region.
- One-way entrances suck the slime in (player.pull_into_tube); blow zone
  is now 1 tile; blown motes are white. TubeBlower -> TubeAirCurrents.
- Validator: generous "might get to" areas vs strict SlimeMoves model
  (surface slides, corners, wraps, 1-tile gaps, ceiling falls, tubes,
  forced suction/blow tiles as all-outcomes states).
- maze_check: new hand-made blow-zone and suction traps.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 16:15:23 -06:00

45 lines
2.3 KiB
GDScript

class_name MazeSettings
extends RefCounted
# What the player picked for the next maze (the Maze setup panel sets these,
# MazeLevel reads them), and what each complexity level means. See docs/MAZE.md.
const MIN_WIDTH = 1
const MAX_WIDTH = 4
const MIN_HEIGHT = 1
const MAX_HEIGHT = 3
const MIN_COMPLEXITY = 1
const MAX_COMPLEXITY = 5
# Per complexity level (index 0 is level 1):
# regionsPerScreen: how the maze regions split each screen (columns, rows).
# Regions are joined only by tubes.
# corridorWidth: corridor width in tiles (walls are 1 tile). 1 is the
# narrowest the slime gets through (checked in the game).
# braid: the share of dead ends opened into loops (0 = a perfect maze).
# oneWayOnRoute: how many tubes between regions on the Start-End route are one-way.
# extraTubesPerScreen: tubes between regions on top of the spanning tree.
# wallPipesPerScreen: short tubes through a wall inside a region (shortcuts).
# steeredShare: the share of two-way tubes that are manual or goo, not auto.
# winding: how much tubes between regions wander (0 = shortest path).
const LEVELS: Array[Dictionary] = [
{regionsPerScreen = Vector2i(2, 1), corridorWidth = 3, braid = 0.5, oneWayOnRoute = 0,
extraTubesPerScreen = 0.0, wallPipesPerScreen = 0.0, steeredShare = 0.0, winding = 0.5},
{regionsPerScreen = Vector2i(2, 1), corridorWidth = 2, braid = 0.3, oneWayOnRoute = 1,
extraTubesPerScreen = 0.5, wallPipesPerScreen = 1.0, steeredShare = 0.2, winding = 1.0},
{regionsPerScreen = Vector2i(2, 1), corridorWidth = 2, braid = 0.15, oneWayOnRoute = 2,
extraTubesPerScreen = 1.0, wallPipesPerScreen = 2.0, steeredShare = 0.3, winding = 2.0},
{regionsPerScreen = Vector2i(1, 1), corridorWidth = 1, braid = 0.05, oneWayOnRoute = 3,
extraTubesPerScreen = 1.0, wallPipesPerScreen = 3.0, steeredShare = 0.35, winding = 3.0},
{regionsPerScreen = Vector2i(1, 1), corridorWidth = 1, braid = 0.0, oneWayOnRoute = 4,
extraTubesPerScreen = 1.5, wallPipesPerScreen = 5.0, steeredShare = 0.4, winding = 4.0},
]
static var width := 2 # In screens.
static var height := 1
static var complexity := 2
static var mazeSeed := 0 # 0: pick a new random one when the maze is made.
static func get_level(level: int) -> Dictionary:
return LEVELS[clampi(level, MIN_COMPLEXITY, MAX_COMPLEXITY) - MIN_COMPLEXITY]