Skip to content

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

License

Notifications You must be signed in to change notification settings

zerebos/BlockCatcher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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 Blocks โ†’ 1 point โ€ข Large & leisurely โ€ข Perfect for beginners
  • ๐ŸŸฃ Purple Blocks โ†’ 5 points โ€ข Medium challenge โ€ข The sweet spot
  • ๐Ÿ”ท Cyan Blocks โ†’ 25 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?

  • Bun โ†’ Lightning-fast runtime and bundler
  • TypeScript โ†’ Type safety without complexity
  • WebGL โ†’ Hardware-accelerated graphics
  • Web Audio API โ†’ Immersive sound design
  • Happy-DOM โ†’ Realistic testing environment
  • GitHub Actions โ†’ Automated deployment

๐Ÿค 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