Game Design & Development · Tiny-Loop Tutorial · Archetype #8
Tutorial: Rhythm Tap Game
This is the exact Rhythm Tap Game archetype from What Makes a Game? — already built and running below. Play it, then swap the note theme, speed, and timing forgiveness using the panel underneath. You can't break the loop itself; that part is locked. Once you've tuned a version you like, you'll build this same architecture two more times: with Scratch's blocks, then from real scratch in JavaScript.
🗺️ The Architecture
Every tiny-loop game starts as a concept, then gets broken into a core loop, a systems list, and a structure — before anyone touches sprites or colors. Here's the Rhythm Tap Game's architecture:
The four systems, in order of execution every frame:
- Spawner system — every fixed interval, a new note appears in one of three lanes at the top.
- Scroll system — every note's y position increases each frame, so notes drift toward the target line.
- Timing-window system — a key press checks the closest note in that lane against the target line: very close counts as "Perfect," a bit farther counts as "Good," far away counts as a miss. A note that falls past the line untouched is a miss too.
- Scoring system — Perfect and Good hits add different point values, and every hit in a row grows your combo. A miss resets the combo to zero.
🎮 Play & Customize
Three lanes, three inputs: ← (left lane), ↓ (middle lane), → (right lane), or the matching touch buttons below the game. Press or tap exactly when a note crosses the glowing line. Notes arrive on a steady beat, so listen to the rhythm and don't just watch it. Sound is off by default. Turn it on with the 🔈 button.
Keys only work while the game has focus. Press P or Esc to pause.
Tune the Game (limited, on purpose)
Content settings change how it looks and apply instantly. Rule settings change how it plays, so the round restarts.
Notice what you can't change here: there's no field for "how Perfect vs. Good is decided" or "how notes are spawned." That's the engine — the part every version of this game shares. You're only tuning content, not rewriting architecture. That's the limit, on purpose.
What the sliders actually touch in the engine: Note Speed feeds two places at once — it shortens the spawn timer (max(70 − speed×6, 30)) and speeds up how fast notes fall (1.2 + speed×0.9 pixels/frame) — so faster songs also arrive more often. Timing Forgiveness only widens the perfectWindow (10 + window×8 pixels) that onKeyPress() compares your tap distance against — the Perfect/Good/Miss scoring math itself never changes.
👀 Peek at the Code
The game running above is this code — nothing hidden. It's split into two parts on purpose: a small config object you just edited with the panel, and a locked engine that reads it.
✏️ Config — this is what the panel above editsconst config = { theme: 'drum', speed: 3, window: 2, winScore: 30 };
👆 This block updates live. Change anything in the panel and the matching value flashes here. There's no separate "demo" version of the code; this is it.
🔒 Engine — locked, shared by every version of this gamefunction onKeyPress(lane) { // 1. find the closest note in this lane const note = closestNoteInLane(lane); if (!note) return; // 2. measure the distance to the target line const distance = Math.abs(note.y - targetY); const perfectWindow = 10 + config.window * 8; const goodWindow = perfectWindow * 2; // 3. score based on accuracy if (distance < perfectWindow) { score += 3; flash('Perfect!'); } else if (distance < goodWindow) { score += 1; flash('Good'); } else { flash('Miss'); return; } // 4. a hit removes the note and grows the combo removeNote(note); combo++; } // every tick: a note that falls past the line is a miss if (note.y > targetY + goodWindow) { removeNote(note); combo = 0; flash('Miss'); }
🧪 Remix Challenges
The panel can only turn the knobs the engine exposes. To change the rules, you change the engine. Each challenge edits one system. Try them in your own copy once you've built it in Lesson 2.
TweakCombo multiplierScoring system · one line
Make streaks worth more: every 10 hits in a row adds ×1 to each hit's points. Now a single miss hurts a lot more. Is that more fun or just more stressful?
score += (perfect ? 3 : 1) * (1 + Math.floor(combo / 10));
TwistWrite a real chartReplace the random spawner
Real rhythm games don't pick lanes at random. A designer writes a chart that lines each note up with a song. Replace spawnNote()'s random lane with the next entry in an array, and you've gone from a game to a level editor.
const chart = [0, 1, 2, 1, 0, 0, 2, 2]; // lane per beat const lane = chart[beat % chart.length];
TransformAdd a way to loseNew system: health
Right now you can't lose, only win slowly. Add a health bar: every miss drains it and every Perfect refills a little. At zero, the song stops. One new system changes the game's whole emotional shape.
🛠️ Now Build It For Real
You've played a working Rhythm Tap Game and seen exactly how it's built. Next, build this same architecture yourself — twice, in two different tools.
🧩 Step 1 — Build It in Scratch
The "Build the Loop with Blocks" section above already shows the exact scripts — backdrop, sprites, variables, and all three lane scripts, block by block, in Scratch's own category colors. Open a Scratch tab side-by-side and copy each script exactly; the game should come to life the same way it does here.
Open a blank Scratch project tab →Want more practice first? There's no official in-editor deck for rhythm games specifically, but the official Make Music tutorial covers the play-sound and timing blocks these lanes build on.