Major improvements:
- NumPy-based collision system supporting 200+ units (~3ms/frame)
- Spatial hashing with vectorized distance calculations
- 4-pass game loop ensuring correct collision timing
- Blood overlay system with pre-generated stain pool
- Cached render positions and viewport bounds
- Spawn protection preventing rats spawning on weapons
Bug fixes:
- Fixed bombs not killing rats (collision system timing)
- Fixed gas not affecting rats (collision system timing)
- Fixed rats spawning on weapons (added has_weapon_at check)
- Fixed AttributeError with Gas collisions (added isinstance check)
- Fixed blood stain transparency (RGBA + SDL_BLENDMODE_BLEND)
- Reduced point lifetime from 200 to 90 frames (~1.5s)
- Blood layer now clears on game restart
Technical changes:
- Added engine/collision_system.py with CollisionLayer enum
- Updated all units to use collision layers
- Pre-allocate NumPy arrays with capacity management
- Hybrid collision approach (<10 simple, ≥10 vectorized)
- Python 3.13 compatibility
- Introduced a hybrid collision detection approach that utilizes NumPy for vectorized operations, improving performance for games with many entities (200+).
- Added a spatial grid for efficient lookups and AABB (Axis-Aligned Bounding Box) collision detection.
- Implemented a new `CollisionSystem` class with methods for registering units, checking collisions, and managing spatial data.
- Created performance tests to benchmark the new collision system against the old O(n²) method, demonstrating significant speed improvements.
- Updated existing code to integrate the new collision detection system and ensure compatibility with game logic.
- Added ScoreAPIClient for communication with the Mice Game Score API, including methods for user signup, score submission, and leaderboard retrieval.
- Developed a simple profile manager demo to showcase user profile management and API integration.
- Created a test script for the Score API to validate all endpoints and functionality.
- Introduced UserProfileIntegration to manage user profiles, including local storage and API synchronization.
- Added a JSON file for user profiles with sample data for testing and demonstration purposes.
- Created gameinfo.xml for the Mice! game, detailing its description, release date, developer, and genre.
- Added mice.sh script to activate the conda environment and run the game.
- Implemented colorize_assets.py as a placeholder for future asset colorization functionality.
- Developed convert_audio.py to convert audio files to 8-bit unsigned format at 22100 Hz.
- Introduced maze.py for generating mazes using Depth First Search (DFS) with a graphical interface.
- Created resize_assets.py to resize PNG assets to 18x18 pixels and center them on a 20x20 canvas.
- Updated the Unit base class to include common attributes and methods for all units.
- Refactored Bomb, Point, and Rat classes to inherit from the new Unit class structure.
- Implemented a consistent die method across units for better cleanup.
- Removed redundant code in unit initialization and added specific attributes where necessary.
- Deleted obsolete configuration file and added a comprehensive architecture guide for future reference.