What it does
The tower is a column of round platforms, each cut into equal sectors that are safe, hazard or gap. The ball falls
under gravity and bounces off what is under it. Contacts use the ball's angular footprint, its centre and both edges, so
a gap has to be wide enough for the whole ball, not just its middle. In the helix preset the player turns the tower to
bring a gap under the ball and loses on a hazard. In the smash preset the platforms turn by themselves; while the
player holds, the ball dives and breaks safe platforms, and a hazard under it ends the round, but released, every
platform simply bounces it.
Every descent, through a gap or a smashed platform, adds to the streak and scores more than the last; a bounce resets
it. Once the streak reaches a set length, the next platform breaks whatever its sectors, a power smash. The ball is
simulated in fixed 1/120 s ticks, and pointer gestures map straight on: press marks an undo point and, in smash,
starts the hold, drag turns the tower, and release lets go.
generateDropTower builds a level from a seed and a difficulty, then certifies it by replaying a winning controller to
the bottom; the winning inputs come with the level, and hint() gives the next one during play. Medium and harder
towers that could be cleared mostly by doing nothing are rejected. For an endless game, addLayers appends a freshly
generated section below the last platform as the ball goes down. The rules have no renderer: draw the platforms as 3D
rings, or the sector under the ball as a 2D strip.
Features
- Two presets —
helix, where you turn the tower to find gaps, andsmash, where you hold to dive through and release before a hazard. - Footprint contacts — the ball's centre and both edges are sampled, so near misses behave fairly.
- Streaks and power smashes — rising scores for consecutive descents, and a power smash that breaks any platform.
- Seeded, certified levels — easy to very hard, with more floors and hazards, narrower gaps and faster spin, each shipped with a winning solution and metrics.
- Six smash layout families —
cone,hourglass,drums,corkscrew,split-sectorsandalternating-bands, cycled by seed. - Endless descent —
addLayersstreams generated sections below the tower. - Undo and checkpoints — undo points before every landing and on each press, redo, and automatic checkpoints every few layers for "retry from the last checkpoint".
- Hints — the certifying controller's next input, for a hint button or an autopilot.
- Pointer controls — press, drag and release, with drag sensitivity and a cap on a single drag.
Good for
- Tower-descent games in the style of Helix Jump, where the player drags to turn the tower.
- Hold-to-smash games in the style of Stack Ball, with a single touch and a dive.
- Endless one-touch mobile games, streaming sections as the ball falls.
- Level packs with daily seeds, since every generated tower is reproducible from its parameters and proved winnable.
- 2D or 3D presentations, from ring meshes to a flat strip.
Make it yours
A TowerConfig sets the preset, the layers and the physics: gravity, bounce speed, ball radius, the ball's distance
from the axis, the fastest turn a hint asks for, the streak for a power smash, the checkpoint spacing, terminal fall
speed, dive speed and start height. Each layer has a height, a starting phase, its own spin, a drawing radius, a shape
(circle, square or hexagon) and 8 to 40 sectors. The generator takes the seed, difficulty, preset, floors, sector count,
gap width, hazard count, spin, shape and any physics override. Pointer controls set drag sensitivity, the most one drag
turns and whether presses mark undo points.
Two different games from one pack: a calm helix tower of nine floors with wide gaps, no spin and generous checkpoints, played by dragging; and a hard endless smash run of square platforms with many hazard sectors, fast spin and a power smash every five descents, streamed section by section.
A quick look
A generated helix tower played with a pointer:
const level = game.dropTower.generateDropTower({ seed: 29, preset: 'helix', difficulty: 'medium' });
const tower = game.dropTower.createDropTower(level.config, { dragTurn: 0.012 });
game.step('tower', dt => {
if (pointer.pressed) tower.press();
if (dragging) tower.drag(pointerDx);
if (pointer.released) tower.release();
tower.step(dt);
draw(level.config, tower.state);
});
Works with
paddle-ballandphysics-2d— for a ball that moves freely in the plane.stack-timing— for stacking pieces upward instead of falling down.
Good to know
- The ball does not move sideways, roll or hit the pillar; contacts are footprints on horizontal platforms.
- A platform's radius and shape are for drawing; the rules use the track radius and the sectors.
- A generated tower has 3 to 50 floors and a tower holds at most 10,000 layers; build longer runs by appending.
- A certificate proves one winning run from the start, not that every position can be recovered or that appended sections join winnably.
statereturns a copy on every read, so read it once a frame.






