Skip to main content

▸ tap the pond

Vibe Lab·GRAVITY

Two dozen worlds dance around a star

A pixel orrery. Two dozen tiny planets glide around a yellow sun, each one pulled in by the same single rule Newton wrote down in 1687: gravity falls off as one over distance squared. Tap or drag anywhere on the canvas to drop a brand-new planet at your finger and watch it find its own orbit. The screen caps out at fifty.

What it does

Each planet has a position and a velocity. Every frame we point a vector from the planet to the sun, scale it by SUN_MU / r^2 to get the gravitational acceleration, and integrate forward in time with semi-implicit Euler over four sub-steps. A small softening length keeps the math finite when a planet grazes the sun.

In the real world

Newton's universal law of gravitation, the same one rule that holds the Moon around Earth, Earth around the Sun, the Sun around the galaxy, and gives us Kepler's three laws of planetary motion as a free side effect.

Painted with these colors

Every VibeBoy lab paints with these 16 colors — the same palette PICO-8 made famous. Constraints are what make pixel art feel like pixel art.

12 of 15