10Game · Physics · Graphicsgame

LensingA puzzle game about bending light with gravity

Gravity is your only tool: where do you put a moon, a star or a black hole so the light finds its way home?

Lensing on a desktop screen
Lensing on a phone

Summary

Place masses to bend beams of starlight into telescopes. Thirty hand-made levels, an endless mode and a level editor — the one project here made purely for fun.

What you can do

  • 30 hand-made plates in three chapters, each with a reference solution and a par.
  • Endless mode: puzzles built around hidden masses, so every one is solvable.
  • A level editor with share codes; winning a test play stores a solution for hints.
  • Black holes that capture light, voids that push it away, tinted nebulae and focusing fans of beams.
  • Synthesised sound, haptics, full keyboard play and screen-reader announcements.

How it works

Each beam is integrated as a ray that bends toward every mass with a pull falling off as M/r². Far from a mass this reproduces Einstein’s 1/b deflection law; a black hole captures beams aimed inside its critical distance and loops those just outside.

The hard part

Making a physics puzzle genuinely fun: a smooth difficulty curve, each level’s solution window measured by a level-lab script, and beams re-tracing at 60 fps while you drag.

Validation

Weak-field deflection vs 2μ/b (b = 3 000)
+0.24 %
Starlight grazing the Sun
1.7512″ vs 1.75″
15 strong-deflection cases vs the exact integral
worst 0.028°
Endless generator, 6 000 puzzles
all solvable, none won empty
All 30 plates
won by dragging in the real interface

Built with

  • TypeScript
  • Canvas
  • Web Audio

Skills it demonstrates

  • Game design
  • Level design
  • Numerical integration