Commit a4a0178
feat(examples): AfterBurner-style Camera3d showcase MVP
Behind-the-plane arcade shooter using Camera3d perspective + the new
sortOn=depth painter's algorithm. Monster.png placeholder for the
jet and enemies (Kenney Space Kit meshes ship in a follow-up once
the multi-material OBJ pipeline lands).
Mechanic skeleton:
- Player jet at fixed z=200, XY movement clamped to play bounds
(arrows / WASD, hold to repeat)
- Bullets at +Z velocity, rate-limited fire (space)
- Enemies spawn at z=3000, partial-homing toward player's spawn-time
XY, fly at -Z toward camera
- Sphere collision: bullet vs enemy → score+100; enemy vs player →
game over + R restart
- HUD: arcade font score top-left, centered game-over overlay
Camera + backdrop:
- Decoupled chase cam: loose XY follow (0.3) so the jet feels mobile
on screen, but pitch / yaw / roll driven directly from player
position for dramatic banking at the play-bound corners
- Custom SkyboxStage paints a sunset sky → desert ground gradient
before the world draws, via ortho projection swap (Camera3d's
perspective projection isn't usable for screen-space backdrops).
Horizon Y tracks camera.pitch (`tan(pitch)/tan(fov/2)*h/2`); whole
backdrop rotates around screen center to match camera roll.
- Animated speed-line chevrons fan out from the vanishing point each
frame, scrolled by the stage's update tick — sells the Mach-2
forward-motion feel even with placeholder sprites.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent d285482 commit a4a0178
2 files changed
Lines changed: 554 additions & 0 deletions
0 commit comments