Neon Tiles - Twinkle Twinkle Little Star
By Just Sparrow
6 viewsยท2h ago
๐น Neon Tiles โ Twinkle Twinkle Little Star
A neon-styled 4-lane rhythm game built around the classic "Twinkle Twinkle Little Star" melody. Tap the falling tiles in time, or hold them down for sustained notes. Cyberpunk visuals with a cyanโmagenta gradient palette and the Orbitron typeface give it a retro-futuristic arcade feel.
๐ฎ How to Play
- Tap / Click โ Tap tiles on mobile, or click them with the mouse on desktop.
- Keyboard โ Use
DFJKfor the four lanes (left โ right). - Hold notes โ For taller tiles (half notes), keep the key/finger pressed until the tile clears.
- Pause โ
SpaceorP - Mute / Unmute โ
M - Quick start / restart โ Press
Jwhile any overlay is showing.
โจ Features
๐ต Real Melody, Real Pitch
- Plays through all six lines of "Twinkle Twinkle Little Star" per cycle, in C major.
- Mix of 1-beat tap tiles (quarter notes) and 2-beat hold tiles (half notes at phrase ends) for natural musical phrasing.
- Each note plays at its actual pitch โ you're literally performing the song, not hitting random tones.
- Hold tiles produce a sustained tone that rings until you release, with crisp gated envelopes for taps.
๐ Progressive Difficulty
- BPM increases by +15 each cycle (60 โ 75 โ 90 โ 105...), so the longer you survive, the faster the tiles fall.
- The melody is also transposed up by a whole step (2 semitones) every cycle, raising the key as the tempo climbs โ fresh tonal challenge on each loop.
๐จ Polished Neon Visuals
- Hand-tuned per-lane colors along a cyan โ blue โ purple โ magenta gradient that matches the logo.
- Glowing tube borders, soft outer halos, and scanline textures only inside the active press zone so the tappable area is instantly readable on hold tiles.
- Animated "neon tile" START button that physically slides down the board into the game on press โ no jarring screen transitions.
- Score-burst flash animation on every successful hit.
๐ง Smart Lane Distribution
- Lanes are picked dynamically rather than randomly: the algorithm avoids consecutive same-lane spawns and balances left vs. right side usage, so the gameplay always feels fair and varied.
๐ฏ Forgiving Hold Timing
- Hold tiles only require 75% of the full duration โ releasing slightly early still counts. This was a deliberate choice to reward feel over frame-perfect precision.
- The hold-progress fill uses a soft gradient fade at its top edge instead of a hard line, so there's no visible pass/fail boundary to fixate on.
๐ผ Combo & Scoring
- 10 points per beat cleared (so a 2-beat hold = 20).
- +50 bonus every 10-tile combo, with a sparkly chime cue.
- High score saved locally via
localStorageand shown on the start and game-over screens.
๐ฑ Mobile-First Input
- Multi-touch support โ different fingers on different lanes are tracked independently via
touch.identifier. touch-action: noneanduser-scalable=noto prevent scrolling/zooming during play.- Viewport sized in
vwunits (9:16 portrait,177.78vwtall) so it scales perfectly across phone screens. - Mouse-up listener attached to
windowso releases register even if the cursor leaves the canvas.
๐ ๏ธ Tech Stack
- Pure HTML / CSS / JavaScript โ zero dependencies, zero build step.
- HTML5 Canvas for the 360ร640 game board with hand-rolled rounded-rectangle drawing and gradient fills.
- Web Audio API with
OscillatorNodefor real-time tone synthesis โ square wave fundamental + octave overtone, with separategate,bell, andsustainenvelope shapes. - Google Fonts (Orbitron) for the futuristic display type.
- localStorage for persistent high score.
- Single self-contained
.htmlfile โ drop it anywhere, open in a browser, and play.
๐ก Things to Try
- See if you can survive past cycle 3 (BPM 105+, key transposed up a minor third).
- Chain a perfect run for combo bonuses โ every 10 hits stacks +50.
- Try it on mobile with two thumbs vs. desktop with
D/F/J/Kโ different muscle memory entirely.
Loading comments...
Other Codes
No other codes yet