Mode 7 flying — a Pilotwings-style demo (#4, part 2).
A plane over a Mode 7 landscape. The core trick: altitude drives the Mode 7 scale — climbing zooms the plane texture out (you see more terrain), diving zooms in, and a shadow sprite slides away from the plane as you climb: the two classic SNES depth cues, from two register writes per frame.
- D-pad left/right: turn — up: climb — down: dive
- A: throttle up — B: throttle down
- Objective: land on the three striped pads (slow + low over a pad). The backdrop flashes green on a good landing; water is a splash (respawn); fields bounce you back up.
ROM mode: LoROM (project default).
- SNES Concepts
- Altitude as Mode 7 scale: mode7SetScale(0x0100 + alt) then SetAngle (the scale feeds the matrix at SetAngle time)
- The shadow depth cue: same sprite shape, dark palette, screen offset proportional to altitude
- Surface classes read through a banked-data ASM accessor (B2 — same pattern as mode7_racing)
- Fixed-point flight model: heading/speed/altitude in 8.8, the math module's shared 0-255 angle unit
- What to Observe
- Take off (hold A, then Up): the fields shrink and the shadow drifts down-screen. Line up a pad, throttle down, descend — a green flash counts the landing. Ditch in the river to see the respawn.
- Modules Used
- console, dma, background, sprite, math, mode7, input
- See also
- gen_terrain.py — the reproducible terrain generator