Examples
A gallery of little programs, each one a complete Ruby 2D app in a single file. Click any card to run it right here in your browser, then poke at the code and make it yours.
Games
Playable classics, built from scratch in a few hundred lines.
Snake
Classic snake โ steer with arrow keys, eat to grow, don't cross yourself.
Breakout
Classic brick breaker โ bounce the ball into the wall and clear the board.
Asteroids
A small clone of the classic, doubling as a tour of Ruby 2D fundamentals.
Out Run
A pseudo-3D arcade racer, classic Sega-style โ a rollercoaster of big hills and near-constant curves.
Hill driver
Drive across rolling hills, catch air off the crests, and grab fuel cans
Platformer playground
A tiny side-scrolling platformer scene built from Ruby 2D shapes.
Ray casting maze
A small pseudo-3D maze rendered from a 2D grid by ray casting.
Simulations
Little worlds that run themselves โ physics, particles, and cellular automata.
Boids
A flocking simulation governed by separation, alignment, and cohesion.
N-body
Thousands of motes of dust orbit a gravity well, shearing into spiral arms.
Particle fireworks
Click to launch rockets that arc upward and explode into fading sparks.
Bouncing balls
Colorful balls fall under gravity, losing a little energy with each impact.
Double pendulum
Two arms swinging from a fixed pivot, tracing a cycling rainbow trail.
Conway's Game of Life
Paint live cells and watch Conway's classic cellular automaton unfold.
Swarm
Drifting dots linked to their nearest neighbors form a living mesh.
Math & fractals
Beautiful structures hiding in equations.
Mandelbrot zoomer
Click to zoom into the Mandelbrot set, rendered fresh to a Canvas.
Fractal tree
A recursive tree grows, then leafs through the seasons in a procedural breeze.
Lorenz attractor
Lorenz's three-equation convection model traces its butterfly attractor in 3D.
Fourier epicycles
A chain of rotating circles traces a heart โ the DFT made visible.
Marching squares
Drifting metaballs merge and split as the iso-line is extracted live.
3D wireframe
A wireframe sphere drawn entirely from 2D Polyline primitives.
Bezier curve editor
Drag the four control points to reshape a cubic Bezier curve live.
Algorithms & AI
Watch a search unfold, a tour untangle, a network learn.
Toys & apps
Interactive things to poke at, and a few practical bits.
Pixel paint
An interactive painting app built with Canvas, with a full tool palette.
Constellations
Click to place stars that auto-link to nearby neighbors into emerging patterns.
2D shadow casting
A top-down flashlight paints a lit region behind sharp obstacle shadows.
Dashboard widgets
An analog clock, live gauges, and an activity chart built from primitive shapes.
UI controls
A small control panel made from Ruby 2D shapes: tabs, buttons, toggle, sliders.
Gamepads
Connect one or more controllers, claim a color, then drop into the field.
Logo animation
An animated version of the gem logo with staggered assembly and idle shimmer.