- Project Name: BRICK RUNNER
- Genre: 2D Arcade Brick-Breaker
- Vision: A fast-paced, retro-futuristic, cyberpunk-themed brick-breaker game designed for player engagement and replayability, featuring unique power-ups, dynamic scoring, and a highly polished audio-visual presentation.
- Current Status: Feature-complete as of the last stable version; fully playable, highly responsive, and includes a custom soundscape. Key development iterations focused on enhancing player feedback, visual flair, and game mechanics.
- Key Accomplishments:
- Sophisticated power-up system
- Dynamic scoring (including a skill-based Roof Bonus and Neon Legend status)
- Custom sound engine
- Note on Development History: Faced recurring issues with corrupted/minified JavaScript delivery. The current codebase is a manually verified, stable version prioritizing clean structure and reliability.
This section details all implemented features in the current stable version of BRICK RUNNER.
- Objective: Classic brick-breaking gameplay.
- Mechanics: Paddle, ball, and a grid of destructible bricks.
- Scoring: Points awarded for breaking bricks; shown in the top-left UI.
- Game Over: Occurs when the ball falls below the paddle.
- Victory: All bricks destroyed.
- Types (Emoji representation):
- 🍄 Expando: Increases paddle width (stacking duration).
- 🐌 Slow-Mo: Reduces ball speed (stacking duration).
- 🧲 Mag-Lock: Sticky paddle for controlled launch (refreshing duration).
- 🎯 Laser Blast: Fires lasers from paddle (Spacebar action; refreshing duration).
- Visuals:
- Emoji indicator above bricks on spawn.
- Active power-ups displayed in top-right UI with timer bars and stack counts.
- Audio:
- Unique sounds on spawn, activation (pitched “bounce” or “laserFire”), and expiration (pitched “multihit” or “grow_reversed”).
Multi-Hit Bricks
- Require two hits to destroy.
- Visual: black “notch” disappears on first hit.
- Audio: “thud” on first hit; “power chord” on second (via pitched multihit).
Roof Bonus
- Activated by hitting the top edge of the play area.
- Visual: ball glows gold (
.bonus-active). - Effect: Next brick broken yields 1.5× points (15 instead of 10); deactivates on next brick or paddle hit.
“Neon Legend” Status
- Achieved at > 500 points in a single game.
- Visual: ball emoji changes to 😎.
- Audio/UI: special notification + “win song.”
- Thematic Design: Retro-futuristic/cyberpunk neon palette.
- Game Title: “BRICK RUNNER” with glitch animation.
- High Score: Always visible in top-right header (e.g., “High Score: 625”).
- Notifications: Hologram-style stacking pop-ups for power-ups and status updates.
- Feedback: Ball impact and brick-shake animations.
- “Click to Begin” Screen: Central bouncing emoji; click to proceed.
- Main Start Screen: Animated title + “Press SPACE to Begin.”
- Game Start Sequence:
- Press SPACE →
initGame()→ballIsStuck = true→ intro song →autoLaunchTimeout. - Brief “get ready” phase with ball stuck to paddle.
- Manual launch (Spacebar/Click) before auto-launch.
- Press SPACE →
- End Game Screens: “Mission Complete!” or “System Failure!”, final score, rating, and “New High Score!” if applicable.
- Paddle Movement: Mouse horizontal tracking.
- Spacebar (Unified Action Button):
- Starts game from main menu.
- Launches stuck/magnetized ball.
- Fires laser (if active).
- If multiple actions available, triggers all at once.
- Toggles pause/unpause if no other action applies.
index.html– Main game structurestyle.css– Visual styling and animationsscript.js– Game logic and state management (vanilla JS)
- DOM refs:
gameArea,scoreDisplay,paddle,ball,bricksContainer, etc. soundManager: Web Audio API wrapper (play()accepts pitch/volume, handles reversed sounds).- Power-up config:
POWER_UP_TYPES,POWER_UP_SPAWN_CHANCES. - Audio assets:
soundsToLoad(map of names → URLs + reversable flag),destroySounds,catDestroyPitches. - Ball state:
ballX,ballY,ballSpeedX,ballSpeedY. - Bricks:
let bricks = []array. activePowerUps: Tracks timers.- State flags:
gameOver,gameRunning,ballIsStuck,assetsReady,isRoofBonusActive,isNeonLegend. - Timers:
autoLaunchTimeout,emojiCycleInterval. - Controls:
paddleX,paddleY,leftPressed,rightPressed.
requestAnimationFrame(gameLoop)– Main render loop.gameLoop(timestamp)– ComputesdeltaTime, calls update/check functions, thenrenderGame().updateBallPosition(dt)– Moves ball.checkCollisions()– Detects ball-brick/paddle collisions.renderGame()– Updates CSS positions.
DOMContentLoaded→setupGame(): Initialize overlays, load assets, then show main menu.initGame(): Called bysetupGame()and reset button; resets vars, rebuilds bricks.startGame(): On Spacebar; runsinitGame(), setsballIsStuck = true, plays intro, setsautoLaunchTimeoutforlaunchStuckBall.
- Historical Code Corruption: Frequent JS minification/corruption; current code is manually verified for stability.
- Unimplemented Features:
- Life System & 1-UP: Rolled back; would need a
livesvariable,updateLivesDisplay(),resetAfterLifeLost(), and modify out-of-bounds logic. - Multi-Ball (“Cat!”): Requires refactoring single-ball vars into
balls = []and iterating in all update/collision/render functions.
- Life System & 1-UP: Rolled back; would need a
- Refactoring Notes: Adding multi-ball impacts
checkCollisions(),updateBallPosition(),renderGame(),launchStuckBall(), andcreateOnionSkin().