Skip to content

Rani367/singularity

Repository files navigation

Singularity

A real-time gravitational lensing game for the Playdate. You pilot a one-pixel survey craft in orbit around a Schwarzschild black hole. Crank to aim, A to thrust, B for emergency boost. Score grows the tighter you orbit — but the well grows steeper every second, and the spaghettification is permanent.

Visuals

  • Per-pixel Schwarzschild ray deflection rendered to a 1-bit screen at 50 FPS
  • Bright photon ring at 1.5 r_s
  • Dithered accretion disk with relativistic Doppler beaming (approaching side visibly brighter than receding)
  • Star field warps around the event horizon in real time
  • Periodic supernova flashes from off-screen stars (full-screen inversion)

Tech

  • Written in C against the Playdate C API
  • 2D warp LUT (~144 KB) collapses the per-pixel lensing inner loop to a single table lookup + bit-pack + byte write
  • All hot-path math single-precision float (Cortex-M7 FPU); -Wdouble-promotion enforced
  • No allocations in the update loop; all buffers static at boot

Build

./build.sh simulator   # Build + open in Simulator
./build.sh device      # Build ARM binary for hardware
./build.sh both        # Build both
./build.sh run         # Build sim + launch
./test-on-playdate.sh  # Copy device build to a Data Disk mounted Playdate

Requires the Playdate SDK at ~/Developer/PlaydateSDK or set PLAYDATE_SDK_PATH.

Controls

Input Action
Crank Rotate thrust vector
A (held) Burn thrust
B Emergency boost (5 s cooldown)
System Menu Pause + settings

License

MIT — see LICENSE.

About

A real-time gravitational-lensing black-hole game for the Playdate, written in C — per-pixel Schwarzschild ray deflection at 50 FPS on a 1-bit screen.

Topics

Resources

License

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors