Skip to content

Side-scrolling platformer ​

Goal ​

Adapt templates/side-scroller: double jumps, platforms, patrols and checkpoints.

Files you will edit ​

  • src/game.ts — controls, camera and round rules.
  • src/level.json — actor placement.

Steps ​

  1. Keep characterMovement({ planeZ: 0 }), char.hero and the template's jump budget.
  2. Tune sideScrollCamera bounds; reset it on respawn.
  3. Place axis-aligned SoftPlatform actors. Their half extents are [2, 0.15, 1] before actor scale. Descending characterMovement capsules land on top.
  4. Down+jump calls dropThroughPlatform(hero.entity); allow room below.
  5. Give platforms and pads mesh assets. Mesh props.scale affects only the look.

Verify ​

Run npm test. Test keyboard, gamepad and touch: double jump, rise through a soft floor, land and drop; check lives, respawns, stomps and the goal route.

See also ​