Skip to content
kranzkyPublic

About

A faithful C++/SDL port of David Braben's Lander demo, based on Mark Moxon's commented ARM disassembly.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

119 Commits

Folders and files

Repository files navigation

Lander C++/SDL Port

A faithful C++/SDL port of Lander (Acorn Archimedes, 1987) by David Braben.

This demo was a precursor to the game Zarch (1987) and later Virus (1988) for the Amiga.

Features

  • Full 3D landscape with Fourier-synthesized terrain
  • Physics-based ship controls with thrust, gravity, and friction
  • Destructible objects (trees, buildings, rockets)
  • Particle effects (exhaust, bullets, explosions, smoke, splashes)
  • Falling rocks hazard (score >= 800)
  • Star particles at high altitude
  • Sound effects with spatial audio
  • Smooth edge clipping (Sutherland-Hodgman)
  • Multiple display resolutions and frame rates
  • Persistent settings

Requirements

  • CMake 3.16+
  • C++17 compiler
  • SDL2

Installing SDL2

macOS (Homebrew):

brew install sdl2

Ubuntu/Debian:

sudo apt install libsdl2-dev

Windows (vcpkg):

vcpkg install sdl2

Building

mkdir build
cd build
cmake ..
make

Running

./lander

Controls

Flight Controls

Input Action
Mouse movement Ship orientation (pitch and yaw)
Left mouse button Full thrust
Middle mouse button Hover thrust
Right mouse button Fire bullets

Keyboard

Key Action
Escape Exit game
P Pause / Unpause
Tab Toggle debug overlay
F11 or Alt+Enter Toggle fullscreen
D Toggle debug mode (keyboard flight)

Debug Mode (D)

When debug mode is enabled, use arrow keys to fly:

  • Arrow keys: Move horizontally
  • A/Z: Move vertically

Settings (Keys 1-6)

Key Setting Options
1 Landscape scale 1x (12x10), 2x (24x20), 4x (48x40), 8x (96x80)
2 Frame rate 15, 30, 60, 120 FPS
3 Display resolution 320x256, 640x512, 1280x1024
4 Smooth edge clipping On / Off
5 Sound effects On / Off
6 Star particles On / Off

Settings are automatically saved to settings.cfg.

Gameplay

  • Take off from the launchpad and explore the landscape
  • Shoot objects (trees, buildings, rockets) to score points
  • Land gently on the launchpad to refuel
  • Avoid crashing into terrain or objects
  • At score >= 800, falling rocks begin to appear
  • Fuel is limited - manage your thrust carefully
  • Game over when all lives are lost

Debug Overlay (Tab)

Shows current settings across the bottom of the screen:

12x10  60/58  1280x1024  CLIP  SFX  STAR
  • Landscape tiles
  • Target FPS / Actual FPS
  • Display resolution
  • Clipping (CLIP = on, clip = off)
  • Sound (SFX = on, sfx = off)
  • Stars (STAR = on, star = off)

Project Structure

lander/
├── src/              # Source files
├── test/             # Test files
├── sounds/           # Sound effect WAV files
├── docs/             # Design documents (TASKS.md, PROGRESS.md, ...)
├── scripts/          # Build and release scripts
├── macos/            # App bundle Info.plist
├── windows/          # Version resource for lander.exe
├── tools/            # Icon generator
├── CMakeLists.txt    # Project version lives here
└── README.md

Running Tests

ctest --output-on-failure

Releasing

The version comes from project(lander VERSION ...) in CMakeLists.txt; the release scripts stamp it into the app bundle and lander.exe.

Self-contained builds: releases build SDL2 from source and link it statically (-DLANDER_VENDOR_SDL2=ON), so players need nothing installed. On Windows that is a single lander.exe with the C runtime linked in too; on macOS a universal (Apple Silicon and Intel) app for macOS 11 or later. Everyday builds can use an installed SDL2, such as Homebrew's.

macOS (scripts/build_release.sh): builds dist/Lander.app self-contained and universal, checks it links only system libraries, signs it with the Developer ID certificate (hardened runtime, timestamped), launches it once as a smoke test, notarises it with the lineage-notary notarytool profile, staples the ticket and zips it to dist/Lander-macOS.zip. Override with SIGN_IDENTITY / NOTARY_PROFILE, or use SKIP_NOTARIZE=1 for a quick signed-only build. Without the certificate it produces an ad-hoc signed Lander-macOS-unsigned.zip.

Windows (GitHub Actions, .github/workflows/ci.yml): every PR builds, tests and smoke-tests on Windows and macOS. Pushing a vX.Y.Z tag (matching the CMake version) also signs lander.exe with SSL.com eSigner, using the ES_USERNAME, ES_PASSWORD, ES_CREDENTIAL_ID and ES_TOTP_SECRET repository secrets, and publishes it to the itch.io windows channel with the BUTLER_API_KEY secret, refusing to publish anything unsigned. scripts/build_windows.ps1 does the same build and signing on a local Windows machine (with the ES_* values as environment variables).

To release: bump project(lander VERSION ...), merge to main, tag it (git tag v1.2.0 && git push origin v1.2.0) for Windows, then run scripts/build_release.sh on the Mac and push the printed zip to the mac channel with butler push.

Credits

  • Original game: David Braben (1987)
  • C++/SDL port: This project

License

This is an educational port of the original Lander demo. The original game is copyright David Braben / Frontier Developments.

About

A faithful C++/SDL port of David Braben's Lander demo, based on Mark Moxon's commented ARM disassembly.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages