Skip to content

zerebos/BlockCatcher

Repository files navigation

image

A synthwave-inspired WebGL block-catching game that will test your reflexes and captivate your senses.

Play Now TypeScript Bun WebGL Tests

Fast • Accessible • Beautiful • Tested


🎯 The Challenge

Time is ticking. Neon blocks cascade from the digital sky. Your mission? Catch them all.

In this retro-futuristic arena, you control a sleek white paddle in a race against time. Each block type demands different strategies:

  • 🌸 Pink Blocks1 point • Large & leisurely • Perfect for beginners
  • 🟣 Purple Blocks5 points • Medium challenge • The sweet spot
  • 🔷 Cyan Blocks25 points • Lightning fast • High risk, high reward

Goal: Score 500 points in 60 seconds. Sounds easy? Think again.


What Makes It Special

🎨 Visual Excellence

  • Synthwave aesthetics with neon colors and retro vibes
  • Smooth WebGL rendering at 60fps
  • Responsive design that works on any screen

🔊 Immersive Audio

  • Dynamic sound effects powered by Web Audio API
  • Pitch-shifted audio based on block types and scores
  • Spatial audio that responds to your performance

Accessibility First

  • Full ARIA support for screen readers
  • Keyboard navigation throughout the entire interface
  • Focus management that never leaves you lost
  • High contrast modes for visual accessibility

Engineering Excellence

  • TypeScript for type safety and developer experience
  • Object pooling for smooth performance
  • Comprehensive testing with 141 test cases
  • Modern build system powered by Bun

🎮 How to Play

Controls

← → Arrow Keys    Move your paddle
SPACE             Start game / Pause
Audio Button      Toggle sound

Strategy Tips

  • Start with pink blocks to build momentum
  • Chase cyan blocks when you're confident
  • Watch the timer - panic leads to mistakes
  • Use audio cues to anticipate block drops

🛠 For Developers

Quick Start

# Get the code
git clone https://github.com/zerebos/BlockCatcher.git
cd BlockCatcher

# Install & run (requires Bun)
bun install
bun dev

Commands

bun dev          # Development server
bun run prod     # Production build
bun test         # Run test suite
bun run lint     # Code quality check

Architecture Highlights

🏗️ Clean Architecture

src/
├── managers/    # System orchestration (audio, DOM, input, rendering, pools)
├── entities/    # Game objects (player, blocks) with behavior
├── utils/       # Pure functions (math, geometry, vectors)
├── audio/       # Modular sound effect system
├── types/       # TypeScript definitions
└── styles/      # Synthwave CSS architecture

🧪 Testing Philosophy

  • Unit tests for individual components
  • Integration tests for game mechanics
  • DOM tests using Happy-DOM for realistic environments
  • Edge case coverage including accessibility scenarios

🚀 Performance Features

  • Object pooling prevents garbage collection hitches
  • Efficient collision detection using AABB algorithms
  • Minimal DOM manipulation with batch updates
  • Optimized bundle under 20KB total

📊 Technical Stats

Metric Value
Bundle Size 18.81 KB (JS) + 13.40 KB (CSS)
Test Coverage 141 tests, 100% core functionality
Performance 60 FPS WebGL rendering
Accessibility WCAG 2.1 AA compliant
Browser Support All modern browsers with WebGL

🌟 The Tech Stack

Why these choices?


🤝 Contributing

Love the game? Here's how to make it even better:

  1. 🐛 Report bugs with detailed reproduction steps
  2. 💡 Suggest features that align with the synthwave aesthetic
  3. 🧪 Add tests for edge cases you discover
  4. ♿ Improve accessibility - there's always more to do
  5. 🎨 Enhance visuals with new effects or animations

Development Guidelines

  • Write tests for new features
  • Maintain TypeScript strict mode compliance
  • Follow the existing code style (ESLint configured)
  • Ensure accessibility standards are met

📜 License

Apache 2.0 - Build upon it, learn from it, make it your own.


🎮 Ready to Test Your Reflexes?

► PLAY BLOCKCATCHER NOW ◄

Built with ❤️ using modern web technologies

About

This is a WebGL game in which you must catch as many blocks as possible until time runs out.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published