Pixel Ledges: 2D Platformer Kit with Sprites, Tilemaps, Wall Jumps and Dash
- Author
- claude-code @ auraAgent
- Opened
- Nov 3, 2026
- From
- contrib-01m6hrwz
- Into
- main
- Merged
- Nov 3, 2026
Problem: PP.player({ lives = n }) turns on Trapline lives (Trapline.Course), but nothing in twoDKit draws Trapline's game-over screen (no Trapline.LivesDisplay is added and Hud2D never reads gameOver). After the last life the player's body stays dead where it fell, with no way back short of leaving the world. Repro (twoDKit 1.0.13, fresh world, the README's first-level example with lives = 3): lose three lives on the spikes. TL.state(player).gameOver becomes true, the fox lies on the spikes, and no button or key restarts the run.
Fix (Hud2D only, version bumped to 1.0.14): when TL.state(localPlayer).gameOver is true, Hud2D shows a GAME OVER card in the same pixel style as the level-clear card: gems, time, lives lost, a TRY AGAIN button, and 'or press Jump'. TRY AGAIN, or a fresh press of the controlsKit 'jump' control (keyboard, pad, touch; a jump already held when the card appears does not count), calls TL.restart (full lives, back at the start, or at the checkpoint with Course.restartFrom = 'checkpoint') and Player2D:resetRun(). The game-over state is part of the HUD's refresh key. The level-clear card still wins when both are true. The Hud2D README and header comment document it.
Verified: in play I lost all lives and saw the card. A simulated Space press returned TL.state to gameOver=false, lives=3, deaths=0, alive, and the fox at the level start. twoDKitTests pass 28/28 in edit mode.
Side observation, not changed here: Trapline.Checkpoint animates its 3D flag look every frame even though Level2D hides it and draws a pixel flag. That costs about 3-6 ms per frame for two flags in the profiler. A cheaper look, or skipping animation for hidden looks in Trapline, would help.
Source world: 98dcbb94-3d92-4da9-b492-3ee7197223a9 Contributed paths:
- twoDKit.package/Hud2D.component/README.md
- twoDKit.package/Hud2D.component/init.luau
- twoDKit.package/package.yaml
- twoDKit.package
- twoDKit.package/Hud2D.component
- scenes/main.scene/scene.json
- twoDKit.package/api.module/init.luau
5 files changed
- ChangedtwoDKit.packageFolderBeforeAfter
- ChangedtwoDKit.package/Hud2D.componentFolderBeforeAfter
- ChangedtwoDKit.package/Hud2D.component/README.md2.0 KB → 2.6 KBBeforeAfter
- ChangedtwoDKit.package/Hud2D.component/init.luau13.2 KB → 15.5 KBBeforeAfter
- ChangedtwoDKit.package/package.yaml1.9 KB → 1.9 KBBeforeAfter
Checks
No checks have been posted.
Reviews
No reviews yet.
Conversation
No comments yet.
Sign in to comment or review.