What it does
A round moves the sliding slab on its own clock: you call step(dt) every frame and drop() when the player taps.
The overlap with the slab below is kept and the overhang becomes an offcut, returned with the time it was cut and a
sideways drift for you to animate as it falls; offcuts never affect play. A drop within the perfect tolerance of its
target snaps exactly onto it and adds to the streak, which adds to the score, and an optional regrow rule widens the
slab a little with each perfect drop once a streak is long enough, never past the base size. An overlap too thin to
stand on is a miss and ends the round.
A tower is a list of courses from the bottom up. Each course sweeps along x or z at its own speed and range,
starts at its own phase, moves linearly (turning sharply at the ends) or on a sine (easing at the ends), and can have
an inset target that shrinks or shifts the footprint it should land on. Because courses are relative to the slab
below, courses from any tower can follow any other.
generateStackTiming builds a tower from a seed and a difficulty in one of seven patterns, and returns with it a
solution of waits that lands every course perfectly, proving the tower can be built, along with its measurements.
addStages appends courses as the player climbs, for an endless high-score tower. Undo and redo step back and
forward one drop with the moving slab where it was, and hint() gives the seconds until the next perfect crossing.
Features
- Tap timing — a sliding slab, a drop, an exact axis-aligned trim and offcuts to animate.
- Perfect drops and streaks — a tolerance for perfect landings that snap on and build a scoring streak.
- Regrowth — an optional reward that widens the slab after a long perfect run.
- Authored courses — axis, speed, travel, phase, linear or sine motion, and inset targets per course.
- A seeded generator — seven patterns (alternating, runs, mixed, terraces, spiral, needle and bridge) with a certified perfect solution.
- Endless towers — courses appended as the player climbs, from any generated or authored tower.
- Scoring, undo and hints — configurable points, undo and redo, reset, and the time to the next perfect drop.
- 2D or 3D — two horizontal axes in world units; a side view can use one.
Good for
- One-tap stacking games in the hyper-casual style, in the style of Stack.
- Endless high-score towers that keep adding courses as the player climbs.
- Level-based tower puzzles with authored courses, inset targets and a score to beat.
- Daily challenges, since a seed always builds the same tower and comes with a proof it can be finished.
- Side-on 2D builders that sweep along a single axis.
Make it yours
The pack has no manifest options; towers are configured through its two functions. A StackConfig sets the base
slab's width and depth, the thickness of every slab, the perfect tolerance, the courses (1 to 10,000), an optional
regrow rule and the scoring (by default 10 for a perfect drop plus 2 per streak, and 5 for a trimmed one). The
generator takes a seed, a difficulty (easy, medium, hard or very-hard, each with more floors, more speed and
a narrower window), the number of floors (2 to 60), the speed, the tolerance, the pattern, and optional regrow and
scoring; the parameters it returns rebuild the same level.
Two different towers: a gentle 2D side view whose courses all sweep along x with sine motion, a wide tolerance and
regrowth after three perfects; and a hard 3D tower generated in the spiral pattern, stepping in with inset courses at
very-hard speed, then grown endlessly through addStages with fresh generated chunks.
A quick look
A generated tower, stepped every frame and dropped on a tap:
const level = game.stackTiming.generateStackTiming({ seed: 5, difficulty: 'medium' });
const stack = game.stackTiming.createStackTiming(level.config);
game.step('stack', dt => {
if (tapped && stack.drop().reason === 'perfect') flashTop();
stack.step(dt); // 0 to 0.1 s; split longer frames
for (const slab of stack.state.placed) drawSlab(slab);
const moving = stack.moving();
if (moving) drawSlab(moving);
});
Works with
drop-tower— for a ball falling down a tower instead.faller— for falling-block puzzles with rotation and line clears.physics-2dorphysics-3d— for a physically simulated stack that can topple.
Good to know
- Trimming is exact and axis-aligned; nothing topples, and offcut flight is for drawing only.
- A generated tower has 2 to 60 floors; longer towers come from
addStages, up to 10,000 courses in all. - The certificate proves the tower can be built with perfect drops, not that a trimmed run can still be finished.
statereturns a copy on every read, so read it once a frame, and the miss threshold is fixed.






