← Back
Play

Bubble Blaster

A timed target-popping game where players identify correct answers by tapping bubbles. Supports three game modes (Continuous, Clear All, Quick Pick), four difficulty tiers, and a combo/multiplier system that rewards speed and accuracy. Content is topic-based with educational prompts and explanations.

Game Flow

Topic Selection → Level Selection → Level Intro → Countdown → Playing (timed run) → Results
  • Topic Selection: Choose from available topics (Science Basics, BIM & VDC Fundamentals)
  • Level Selection: Grid of levels with high scores, best grades, and accuracy stats
  • Level Intro: Shows mode description, difficulty, run duration, and tips
  • Countdown: 3-2-1-GO
  • Playing: Bubbles spawn on screen with a prompt displayed at top. Pop correct bubbles, avoid incorrect ones. Run lasts for a configured duration (default 60s).
  • Results: Score breakdown with grade, accuracy, streak stats, and top-5 mistakes review with explanations

Game Modes

Continuous (default)

Bubbles spawn continuously at a rate that ramps up over time. Prompts rotate -- a new question appears after the current one's correct targets are cleared or the prompt timer expires.

Clear All

All targets for a prompt appear at once. Player must find and pop every correct bubble to advance to the next prompt. Incorrect bubbles are mixed in as distractors.

Quick Pick

Multiple choice format: 5 bubbles appear (1 correct, 4 incorrect). Points decay over time -- faster answers earn more. Starting at 150 points, decaying to a floor of 50.

Content Structure

Topic
└─ Level (difficulty, mode, duration)
   └─ Question (prompt text)
      └─ Target (label or image, isCorrect, explanation)

Topics

TopicSlugDescription
Science Basicsscience5 levels, 17 questions -- states of matter, elements, forces
BIM & VDC FundamentalscadMulti-level -- BIM tools, workflows, coordination

Each question has a prompt (e.g., "Click all SOLIDS") and an array of targets with isCorrect flags and explanation strings shown in the mistakes review.

Difficulty Scaling

SettingEasyMediumHardExpert
Spawn rate (start)1/1400ms1/1200ms1/1000ms1/800ms
Spawn rate (end)1/900ms1/700ms1/550ms1/400ms
Target lifetime4500ms3800ms3000ms2500ms
Decoy ratio30%35%40%50%
Target sizeLargeMediumMediumSmall
DriftNoNoNoYes
Score multiplier1.0x1.15x1.3x1.5x

Expert mode adds target drift -- bubbles slowly move across the playfield.

Scoring

Per-Hit Scoring

Hit Score = (100 + Speed Bonus) × Streak Multiplier
ActionPoints
Correct hit+100 base
Speed bonusUp to +75 (reaction < 1200ms)
Incorrect hit-75, resets streak
Missed correct-40, reduces streak (Easy/Medium: -5, Hard/Expert: reset)

Speed bonus formula:

Speed Bonus = 75 × (1 - reactionMs / 1200)

Streak Multiplier

Builds with consecutive correct hits, resets on incorrect hit.

StreakMultiplier
0-41.0x
5-91.2x
10-141.4x
15-241.7x
25-342.0x
35+2.5x

End-of-Run Bonuses

BonusCalculation
Accuracy bonusaccuracy% × 12 (max 1200)
Perfect bonus1500 base, scales with engagement (+20 per hit beyond 10, up to 2x)
Completion bonus500 flat

Difficulty Multiplier

Applied to final score: Easy 1.0x, Medium 1.15x, Hard 1.3x, Expert 1.5x.

Grades

GradeMin ScoreMin Accuracy
S+1200095%
S850090%
A550080%
B350070%
C200055%
D< 2000< 55%

Technical Architecture

Key Files

AreaFilePurpose
Typesgames/bubble-blaster/types.tsGamePhase, GameState, ActiveTarget, RunStats, Difficulty, GameMode, Topic, Level, Question
Configgames/bubble-blaster/config.tsDifficulty configs, mode configs, scoring constants, spawn rates, target sizes
Storegames/bubble-blaster/store.tsZustand store: spawn system, game tick, hit detection, streak tracking, prompt rotation
Contentgames/bubble-blaster/content.tsloadTopic(), getLevel(), shuffleQuestions(), pickTargetToSpawn()
Scoringgames/bubble-blaster/scoring.tscalculateCorrectHitScore(), calculateEndOfRunBonuses(), calculateGrade(), updateStreak()
Audiogames/bubble-blaster/audio.tsAudio pool (8 instances per SFX), pitch variation, background music loop
Hookgames/bubble-blaster/hooks/use-game-actions.tsupdateLevelProgress(), getLevelProgress()
Audio Hookgames/bubble-blaster/hooks/use-game-audio.tsPhase-aware SFX/music management

Components

ComponentPurpose
playfield.tsxGame area with grid background, target rendering, spawn orchestration
target.tsxIndividual bubble: lifetime ring animation, hit feedback, drift (Expert)
hud.tsxScore, timer, streak bar, multiplier badge, prompt + progress bar, pause/mute
results.tsxScore breakdown, grade, top-5 mistakes review with explanations
score-popup.tsxFloating score animations, streak milestone celebrations
level-list.tsxLevel grid with progress cards
level-extras.tsxLevel card metadata: mode badge, run time, accuracy, grade
grade-badge.tsxSmall grade badge
topic-button.tsxTopic selection card

Uses shared components: LevelCard, LevelIntro, Countdown, PauseMenu, ResultsScreen, GameShell, GameHeader, GuestBadge.

Persistence

Storage key: bubble-blaster-state

Save data:

{
  levelProgress: { [topicId_levelId]: { highScore, bestStreak, bestAccuracy, bestGrade, completedAt, attempts } },
  lastPlayedLevel, lastPlayedTopic
}

Score submitted via submitScore() with metadata. Completion signaled via signalComplete().

Notable Mechanics

Grid-Based Spawn System

O(1) positioning algorithm using a grid overlay. Each target occupies a 3x3 cell zone to prevent overlap. Falls back to distance-maximization when the grid is full.

Prompt Timer

Each prompt has a configurable display duration. A visual progress bar under the prompt text shows remaining time. Auto-advances to the next question on expiration (behavior varies by mode).

Audio System

  • Audio pool of 8 instances per sound effect to prevent clipping on rapid hits
  • Pitch variation on hit sounds (±15%) for variety
  • Background music with seamless loop
  • Streak milestone sounds at 5, 10, 15, 20, 25, 30

Streak Celebrations

Visual celebrations at milestones with escalating messages:

StreakMessage
5"NICE!"
10"GREAT!"
15"AWESOME!"
20"ON FIRE!"
25"UNSTOPPABLE!"
30+"LEGENDARY!"

Mistake Tracking

Records every incorrect hit and missed correct target during a run. Results screen shows the top 5 mistakes with the original prompt and target explanation, reinforcing the educational content.

Mobile Optimization

  • Larger touch targets on mobile (+8px padding)
  • Responsive HUD layout switches between mobile and desktop arrangements
  • Safe area handling for notched devices

Target Lifetime Ring

Each bubble renders a circular lifetime indicator using requestAnimationFrame for smooth animation. The ring depletes as the target approaches expiration, providing visual urgency.