Skip to content

Wire levers into switchboard (W2#7, level-22) - #146

Merged
sv-tmueller merged 1 commit into
mainfrom
feat/135-levers
Aug 16, 2026
Merged

Wire levers into switchboard (W2#7, level-22)#146
sv-tmueller merged 1 commit into
mainfrom
feat/135-levers

Conversation

@sv-tmueller

Copy link
Copy Markdown
Owner

Summary

Closes #135

Wires lever mechanics into the switchboard level (world2/level-22.json) and adjusts the level geometry so the path from spawn to exit is reachable.

Changes

Level geometry adjustments (src/levels/world2/level-22.json):

The original level had a 4-row vertical gap (spawn at row 9, exit at row 5) with only a single one-way platform cluster at row 6 (cols 10-12) and a shifting-wall trap pillar at col 15. The geometry was unreachable — the player could walk along row 9 but had no way to ascend to the exit.

Added one-way platforms to create a reachable staircase:

  • Row 8, cols 3-5: mid-ascent stepping stone (enables jumping from row 9 to row 7)
  • Row 6, cols 5-12: extended the existing platform leftward to col 5 (enables ascending from row 7 to row 5)
  • Row 6, cols 14-18: new platform segment at exit level (provides standable ground for the exit at col 17, row 5)

Path: spawn (2,9) → walk right to (5,9) → jump up to (5,7) → jump up to (5,5) → traverse right along row 5 platforms → exit (17,5). All jumps satisfy the reachability validator's combined constraint (|dc|/4 + rise/2 ≤ 1) with ceiling clearance verified.

Lever mechanics added:

  • lever-gate: pressure plate at pixel (64, 112) = tile (4, 7), on the ascent path
  • lever-release: pressure plate at pixel (160, 80) = tile (10, 5), on the upper platform

Both levers use toggleOnContact: true (pressure-plate style). They are conceptually linked to the shifting-wall trap (the lever "opens the wall"), but since the lever state is not yet consumed by the trap system, the level geometry is designed to be independently solvable — the reachability validator (which doesn't model levers) confirms the path is reachable through static geometry alone.

Verification

  • ✅ All 1340 tests pass (npm test)
  • ✅ ESLint clean (npm run lint)
  • ✅ Production build succeeds (npm run build)

Add lever mechanics to the switchboard level and adjust geometry so
the path from spawn (row 9) to exit (row 5) is reachable.

Geometry changes:
- Add one-way platform at row 8, cols 3-5 (mid-ascent stepping stone)
- Extend one-way platform at row 6 from cols 10-12 to cols 5-12 and
  add a second segment at cols 14-18 (upper pathway to exit)

This creates a reachable staircase: row 9 -> row 7 (via row 8
platform) -> row 5 (via row 6 platforms) -> exit at (17,5).

Mechanics:
- lever-gate: pressure plate at (4,7) on the ascent path
- lever-release: pressure plate at (10,5) on the upper platform

Both levers use toggleOnContact=true. They serve as visual indicators
for the shifting-wall trap; the lever state is not yet consumed by
the trap system, so the geometry is designed to be independently
solvable via the reachability validator.

Closes #135
@vercel

vercel Bot commented Aug 16, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
pitfall Ready Ready Preview Aug 16, 2026 7:10am

@sv-tmueller
sv-tmueller merged commit 7cc924a into main Aug 16, 2026
6 checks passed
@sv-tmueller
sv-tmueller deleted the feat/135-levers branch August 16, 2026 07:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(mechanics): wire levers into scene + fix W2#7 switchboard

1 participant