I'll build this two-phase game (Tetris → top-down shooter) carefully. Let me first explore the project structure.
Tailwind v4, React 19, single-file build. Let me check the entry point and cn util.
Project confirmed: Tailwind v4, React 19, single-file build, no type-checking at build (esbuild). Now I'll architect the game:
src/game/shared.ts — palette, power-ups, weapon logic, helpers
src/game/tetris.ts — Tetris engine (canvas)
src/game/shooter.ts — Shooter engine (canvas)
src/components/* — React screens + HUD
src/App.tsx — phase orchestrator
Let me start with the core engines and shared utilities.
Now the Tetris engine:
Now the shooter engine — the largest piece. Let me write it carefully with balanced combat, boss phases, power-ups, and particles.
Let me clean up the unused imports/method in the shooter engine.
Let me verify the current state of the import section.
The parallel edits on the same file conflicted. Let me fix the import now (single edit).
No more errors. Now let me build the React screens. First the Tetris screen with HUD, controls, and mobile touch buttons:
Now the Shooter screen with HUD overlay, boss bar, buff indicators, and touch-drag movement:
Now the menu, transition, and game-over screens:
Now I'll wire up scoring. Let me update the ShooterScreen so phase callbacks carry the earned score (the engine fires them, so the screen reads the engine score). First the Props signature:
Now update the wrapper to pass the score:
Now the main App orchestrator that ties the phase loop together:
Now styling and fonts. Let me update the CSS and HTML:
Now update the HTML title and add the Orbitron font:
A few refinements before building: simplify the enemy-bullet glow rendering, resize the shooter canvas to fit small screens, and clean up the score logic. These are in three different files:
Now tune the boss HP curve for better balance:
All edits applied cleanly. Let me build the project to confirm everything compiles.
The build succeeds. Now let me fix a subtle bug: multiple rapid kills near the boss threshold could schedule multiple boss spawns. I'll use the warning timer as a guard:
Let me verify the final shooter engine state around the boss-threshold logic and class fields:
Let me improve Tetris feel with proper delayed auto-shift (DAS) for left/right holding — the browser's key-repeat alone feels laggy. First, add the DAS fields and update the keyboard handler (two different files):
Now add the shift helper and DAS logic in the update method:
All clean. Let me run a final build to confirm everything compiles.
The game is complete and builds successfully. Here's what I built:
🎮 BLOCK PROTOCOL — a two-phase arcade loop
A neon, canvas-rendered game where a Tetris phase forges your ship's firepower for a top-down shooter boss fight — and the whole cycle repeats, escalating forever.
The loop
- Phase 1 — Assembly (Tetris): Clear lines against a countdown clock. Gravity accelerates during the round and the clock tightens each loop. Combo multipliers reward back-to-back clears and 4-line Tetrises.
- Transition: See exactly which weapon your cleared lines forged.
- Phase 2 — Assault (Shooter): Auto-firing ship battles enemy waves, then a sector boss. Defeat it to advance.
- Repeat — faster blocks + stronger enemies + tougher boss every round. Die → game over with a persisted high score.
How lines power the ship (the core link)
- Weapon level is set by lines cleared this round (1→6): single → twin → triple → quad → piercing penta → piercing hex spread, with rising fire rate & damage.
- Total accumulated lines permanently thicken your hull (max HP scales up), so even a weak Tetris round still grows your survivability. This keeps it rewarding for skilled and learning players.
Power-up ideas (drop from enemies & bosses)
- 💚 Repair (+hull) · ⚡ Rapid Fire (×2 rate) · 🌐 Spread (side cannons) · 🛡️ Shield (absorbs hits) · 🔥 Overcharge (×2 damage) · ✸ Pulse Bomb (clears screen)
- Each has a timed buff bar shown in the HUD; bosses always drop a guaranteed heal + loot.
Balance & fun tuning
- Difficulty scales by round (enemy HP/fire-rate, spawn rate, kills-to-boss), while boss HP, attack variety (radial bursts, aimed volleys, gap-walls, minion summons, spirals) and 3 enrage phases grow each loop.
- Boss HP curve and enemy damage are tuned so a typical weapon level clears a round in a tense-but-fair fight — neither trivial nor brutal.
- Proper Tetris DAS movement, ghost piece, 7-bag randomizer, wall kicks, and screen shake/particles for juicy feedback.
Controls
- Tetris: ←/→ move (hold to slide), ↑ rotate, ↓ soft drop, Space hard drop, P pause
- Shooter: WASD/Arrows to move (autofire on), P pause
- Mobile: on-screen Tetris buttons + drag-to-fly in the shooter
Everything runs on canvas for smooth 60fps, with React managing the phase state machine and crisp Tailwind HUD overlays.
Files built: src/game/shared.ts, src/game/tetris.ts, src/game/shooter.ts, src/components/TetrisScreen.tsx, src/components/ShooterScreen.tsx, src/components/Screens.tsx, src/App.tsx, src/index.css, index.html