A GRAVITY-POWERED SPACE PUZZLE GAME
Gravitydrift is a browser-based physics puzzle game where you launch a spacecraft through a field of planets to reach a glowing destination ring. The catch: once your ship is in flight, you cannot steer it. Gravity does the steering for you.
The game takes its name from the gravitational slingshot maneuver — a real technique used by space agencies to send probes across the solar system without burning enormous amounts of fuel. By flying past a planet at just the right angle, a spacecraft can steal a fraction of that planet's orbital momentum and fling itself toward its destination. Every level in Gravitydrift challenges you to find that angle.
Each level is a puzzle with a physics solution. The satisfaction of finding the right trajectory — watching your ship arc silently through space, bend around a planet, and slide through the destination ring — is the core experience the game is built around.
Gravitydrift models Newtonian gravity. Every planet in every level exerts a continuous gravitational pull on your ship, calculated every frame using the real inverse-square law: force falls off with the square of the distance. Double the distance between your ship and a planet, and the gravitational pull drops to one quarter of its original strength.
The game features nine planet types, each with a different density. A white dwarf-like world exerts a gentle tug; a black hole overwhelms everything nearby. This range of gravitational strengths means every level can present a completely different set of dynamics, even with similar layouts.
The result is a simulation that rewards genuine physical intuition. Players who understand concepts like orbital momentum, gravity assists, and escape velocity will find themselves solving levels that stump pure trial-and-error players. But even without that background, the game teaches these concepts naturally through play.
Want to understand the real science behind the game? Visit the Space Science page for a detailed educational guide to gravity, orbital mechanics, and the history of space exploration.
Gravitydrift is built entirely with vanilla JavaScript — no game engines, no frameworks, no build tools. The rendering is handled by the Canvas 2D API, drawing directly to an HTML canvas element every frame.
The multiplayer system uses WebSockets to keep all players in a room synchronised in real time. A lightweight Node.js server manages rooms, relays messages, and handles the REST API for level storage and retrieval.
Level data and player ratings are stored in Supabase, a hosted PostgreSQL database with a clean REST API. This keeps the server code simple and the data reliably persisted without managing database infrastructure.
The choice to use no frameworks was deliberate. Vanilla JS forces clarity about what the code is doing at every step. There is no magic, no abstraction layer to debug through. The physics loop, the renderer, the WebSocket protocol — every part is readable, hackable, and self-contained.
Gravitydrift ships with a fully functional in-browser level editor. Anyone can open the editor, place planets, set a start position and destination, add checkpoints and force fields, and publish the result to the shared level library.
The editor supports undo and redo, and includes a test mode that lets you play your level directly without saving it first. Levels are stored in a normalised coordinate system, which means they display correctly at any screen resolution and on any device.
Published levels are immediately visible to all players in the Saved Maps browser. The community of players rates each level, and the highest-rated maps float to the top of the discovery feed.
Gravitydrift is suitable for all ages, but it has particular value as an informal educational tool for learners aged 8 and up. Players who engage seriously with the game build genuine intuition for gravitational physics — a subject that is notoriously difficult to teach from equations alone.
The core mechanics mirror real concepts from orbital mechanics and astrophysics. Understanding why your ship curves around a planet, why flying faster doesn't always get you there sooner, and why massive objects are simultaneously useful and dangerous — these are the same questions that aerospace engineers grapple with when planning real missions.
Several educators have used Gravitydrift as a supplementary tool in physics and STEM classes, pairing gameplay with discussion of Newton's laws of gravitation. The Space Science page is written specifically to support this kind of guided learning, with curriculum connections and suggested discussion questions.
Gravitydrift is actively developed. New features, bug fixes, and level editor improvements are released on an ongoing basis. The game is currently in open beta — fully playable, with all core features complete.
Feedback, bug reports, and level submissions are genuinely welcome. If you find an issue, discover a clever level design trick, or have a suggestion for a new feature, please reach out via the contact page. Every piece of feedback is read.
The level library grows entirely through community contributions. Every level you build and publish makes the game richer for everyone who plays it.