ExperimentsFable 5.2 Retro Games

The game has the keyboard when this page opens. If the keys stop working, click or tap the game. On a phone, Play full screen gives the game the whole screen.

  • Original title: Rose Window
  • Inspired by: the Breakout genre (a bar, a ball, and a wall of bricks)
  • File: games/03-rose-window/index.html (one self-contained file, no network requests)
  • Built by: Job B, 2026-11-14

What I built

The wall of bricks is a stained-glass window. The player moves a bar along the bottom and keeps a ball of light in play until every pane is broken.

Additions to the genre:

  • Round windows. The panes are not a grid of boxes. Window 1 is a rose window: a round centre and four rings of curved panes (49 panes). Window 2 is an arched window of 50 box panes. Window 3 is a half-round fan of 39 panes. After window 3 the set repeats with more two-hit panes and a faster ball.
  • True shapes. The ball tests against the real shape of each curved pane, so it bounces off the curved edges and the slanted sides in a natural way.
  • Shattering. A broken pane is cut into triangles around the point of impact. The shards fly out, spin, catch the light, and fall. The lead frame stays, sky shows through the hole, and small pieces of glass stay at the edge of the frame.
  • Two-hit panes. Some panes crack on the first hit. The cracks start at the point of impact.
  • Chain. Each pane broken before the ball returns to the bar raises a multiplier, up to ×8.
  • Gems. Some panes drop a gem. Catch it with the bar: W makes the bar wide for 14 seconds, M splits each ball into three (6 at most), S slows the ball for 9 seconds, and + gives a life (5 at most). The centre pane always drops an M gem.
  • Self-playing start screen. The bar plays by itself behind the start card.

Controls: move the mouse or slide a finger anywhere on the window to move the bar. Click, tap, or press Space to launch. Arrow keys or A and D also move the bar. On touch there are two arrow buttons and a Launch button. A waiting ball launches by itself after 4 seconds.

Looks

  1. Stained Glass (main). A dark stone wall with a stone window frame. Each pane has its own colour gradient, streaks, and bubbles, with dark lead between the panes. The window glows, a slow band of sunlight crosses it, dust floats in the air, and the colours of the window lie as soft light on the floor. The light on the floor changes as panes break. The ball is a point of warm light and the bar is brass with three small jewels.
  2. Green Phosphor. An old computer terminal. Each pane is filled with text characters and outlined in green, with scan lines over the screen. Broken panes burst into falling characters. The bar is [=======].
  3. Petal Garden. The same layouts become flowers: every pane is a petal, the centre is a seed head, the ball is a bee, and the bar is a leaf. Broken petals flutter down slowly.

Techniques

  • All art is drawn by code on a canvas. No images.
  • Collision: for a curved pane, the nearest point to the ball is found in polar form (clamp the distance to the ring, clamp the angle to the segment, and project onto the side edge when the ball is beside the pane). The ball moves in steps of 3 units or less, so it cannot pass through a pane.
  • The panes are painted to a hidden canvas and painted again only when a pane changes. Each frame copies that canvas.
  • The light on the floor is the pane canvas shrunk to 18 by 24 pixels and stretched back, which blurs it at almost no cost.
  • Shards are triangles with their own position, spin, and life. A shard flashes white when its spin angle passes a "facing the light" point.
  • The glass sound is four short high sine tones at random pitches plus a little filtered noise.

What I am proud of

The rose window itself: curved panes with correct bounces, the shatter from the point of impact, and the coloured light on the floor that thins out as the window breaks. The Petal Garden look turns the same level data into a flower, which shows how far a look can go.

Known issues

  • In the Petal Garden look a petal is drawn smaller than the area that the ball hits. The ball (the bee) can bounce a little before it touches the drawn petal.
  • If the look is changed while shards are in the air, those shards keep the style of the old look until they fade. This lasts about one second.
  • The last few panes of a round window can take a while to hit. The bar angle gives control, but there is no aiming aid.
  • The picture is always upright (360 by 480 units). On a phone in landscape it is small (about 230 by 305 pixels) but playable.
  • I did not tune the ball speed with human players.

Self-test

Tested with headless Chrome through .tools/selftest.js at 375x667, 740x360, and 1440x900. Result: all checks passed (no console errors, no network requests, start, pause, restart, all three looks, and all buttons and pads inside the screen).

A second scripted test (.tools/t03.js) confirmed the rules with 14 checks: the ball waits on the bar, Space launches, panes break and score, the wide gem and the multi gem work, the last pane clears the window, windows 2 and 3 have the expected pane counts, a missed ball costs a life, the game ends with no lives, restart works, the mouse moves the bar, and a click launches.

Issues found and fixed during testing:

  • The coloured light on the floor looked like coarse blocks. It is now blurred in two steps and looks soft.
  • The chain multiplier carried over into the next window. It now resets when a new window starts.