Commit Graph

53 Commits

Author SHA1 Message Date
John Doe a908b50019 Add looping gameplay music 2026-05-07 20:03:20 +02:00
John Doe 486fea38e7 Implement game controller support and add keybindings for gamepad input 2026-05-07 17:50:07 +02:00
John Doe 509b3433b8 Refactor rendering logic in MiceMaze and Rat classes for improved clarity and efficiency 2026-04-14 12:15:16 +02:00
John Doe b243cf04d3 Add explosion stage 1 PNG assets for all directions
- Added BMP_1_EXPLOSION_DOWN.png to original and preview directories.
- Added BMP_1_EXPLOSION_LEFT.png to original and preview directories.
- Added BMP_1_EXPLOSION_RIGHT.png to original and preview directories.
- Added BMP_1_EXPLOSION_UP.png to original and preview directories.

These assets are part of the explosion animation for the game, enhancing visual effects during gameplay.
2026-04-14 11:24:16 +02:00
John Doe b60ffd87aa Refactor code structure for improved readability and maintainability 2026-03-28 16:05:08 +01:00
John Doe 02202e4d3d Add new PNG images for clean and preview outputs
- Added `image_clean.png` to the output directory for the clean image representation.
- Added `image_clean_preview.png` for the preview of the clean image.
- Introduced `image_svg_clean.png` for the SVG clean image representation.
2026-03-27 23:40:27 +01:00
John Doe b4224ed3a1 v1.1: Performance optimizations and bug fixes
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
2025-10-24 20:04:26 +02:00
John Doe 12836dd2d2 Implement optimized collision detection system using NumPy
- 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.
2025-10-24 19:13:30 +02:00
Matteo Benedetto c004edef8f Update asset loading to include transparent color and adjust white flash timing; enhance nuclear bomb scoring and gas unit die method 2025-08-21 19:00:32 +02:00
Matteo Benedetto 79369a1dd8 nice 2025-08-21 18:22:39 +02:00
Matteo Benedetto cbb60a19d9 Implement Score API Client and User Profile Integration
- 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.
2025-08-21 17:02:41 +02:00
Matteo Benedetto 17e5abc7df Final 2.0 2025-08-20 16:43:16 +02:00
Matteo Benedetto 8451ac7913 Refactor keybindings configuration and remove obsolete JSON files 2025-08-19 23:21:37 +02:00
Matteo Benedetto 1269913275 Refactor key handling and add keybindings configuration for game actions 2025-08-19 18:59:06 +02:00
Matteo Benedetto 947d464afd Fix window display initialization in KeyLogger and MiceMaze 2025-08-19 16:04:38 +02:00
Matteo Benedetto 3bd2d9269f Add Mice! game and associated tools
- 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.
2025-08-18 00:20:40 +02:00
Matteo Benedetto 8a32aad877 OK 2025-08-17 18:49:07 +02:00
Matteo Benedetto c35fc9f1f7 mine implementation 2025-08-14 16:53:15 +02:00
Matteo Benedetto 243bb6d9bd Enhance blood stain mechanics: add dynamic blood surface generation and integrate blood stains into game rendering 2025-08-13 23:30:43 +02:00
Matteo Benedetto 689b21bf65 Add unit tests for UnitFactory functionality and initialize units package 2025-08-13 20:36:51 +02:00
Matteo Benedetto 3266ce8209 Initialize SDL and load graphics assets in GameWindow constructor 2025-08-12 15:30:45 +02:00
Matteo Benedetto aa907ed80a optimus-l1 2025-08-12 14:48:57 +02:00
Matteo Benedetto 89812d3ed8 Added full-screen toggle option in start menu.
- Added 'toggle_full_screen' key binding to json file.
- Implemented full-screen functionality in rats.py.
2025-01-04 16:11:50 +01:00
Matteo Benedetto 6dc871db54 Aggiorna la gestione dei tasti e aggiungi nuovi file di configurazione per le schermate di pausa e menu di avvio 2024-12-28 00:34:48 +01:00
Matteo Benedetto 98a9e5fb8b Aggiungi file di configurazione per i binding dei tasti e implementa la gestione degli input nel gioco 2024-12-27 19:03:04 +01:00
Matteo Benedetto ccf7769979 Semplifica la gestione audio rimuovendo il supporto per più dispositivi e centralizzando l'uso di un singolo dispositivo audio 2024-12-26 01:14:26 +01:00
Matteo Benedetto 3e7056e23f Rimuovi chiamate non necessarie ai metodi di riproduzione e arresto audio 2024-12-26 00:50:27 +01:00
Matteo Benedetto ebfe9dcceb Aggiungi supporto per la creazione e il disegno di texture di sfondo nel gioco 2024-12-26 00:12:00 +01:00
Matteo Benedetto cb25866754 Aggiungi supporto per audio e migliora la gestione delle dipendenze nel progetto 2024-12-25 02:15:25 +01:00
Matteo Benedetto 3aa9c84b54 Aggiorna la gestione della risoluzione nel file .env e modifica la funzione win_screen per supportare la visualizzazione dei punteggi 2024-12-23 18:31:50 +01:00
Matteo Benedetto 8b213761e4 Aggiungi la funzione count_rats per contare i ratti e aggiorna la logica di gioco; modifica la risoluzione nel file .env e gestisci eccezioni nel metodo pop di Timer 2024-12-23 17:16:05 +01:00
Matteo Benedetto f3fe91ca36 Aggiungi supporto per lo scrolling degli assi nella classe KeyBindings e integra la gestione degli eventi di movimento degli assi nella classe GameWindow 2024-12-23 16:53:37 +01:00
Matteo Benedetto 7f18f7e46e Rimuovi la gestione del rilascio dei tasti e migliora la logica di scrolling nella classe KeyBindings; aggiorna la classe GameWindow per gestire correttamente gli eventi di rilascio dei tasti 2024-12-23 16:31:42 +01:00
Matteo Benedetto 2e4d0b8726 Modifica la gestione dei tasti nella classe GameWindow; aggiungi supporto per il rilascio dei tasti e migliora la logica di scrolling 2024-12-23 16:23:40 +01:00
Matteo Benedetto 97038023d5 Aggiungi supporto per la risoluzione personalizzata e gestione della pausa nel gioco 2024-12-23 00:59:48 +01:00
Matteo Benedetto 42e2f4aa16 Aggiungi il controllo della visibilità per il disegno di immagini e rettangoli nella classe GameWindow 2024-12-22 19:14:50 +01:00
Matteo Benedetto f20e789d80 Modifica la gestione del ritardo nella classe GameWindow e ripristina l'uso di subprocess per la riproduzione audio in MiceMaze 2024-12-22 18:54:26 +01:00
Matteo Benedetto 3f513f1f19 Aggiungi gestione dei controlli da tastiera e migliora la logica di spawn delle unità 2024-12-22 18:12:45 +01:00
Matteo Benedetto 4947b91ae2 Aggiungi supporto per input da tastiera con codici ASCII nel gioco 2024-12-22 01:33:03 +01:00
Matteo Benedetto 0c47d52bbc Aggiorna la gestione della finestra di gioco, modifica la dimensione e il ritardo di rendering, e cambia il suono della bomba 2024-12-22 01:05:21 +01:00
Matteo Benedetto acbd943b27 Aggiungi la classe Point e implementa la gestione delle esplosioni nel gioco 2024-12-17 00:14:02 +01:00
Matteo Benedetto db4cff34b0 Modifica il tasto di attivazione per generare un nuovo ratto da "R" a "Return" 2024-12-16 01:19:31 +01:00
Matteo Benedetto 939e81ca82 Aggiungi gestione dei tasti per il controllo del gioco e modifica il metodo di chiusura della finestra 2024-12-16 01:14:10 +01:00
Matteo Benedetto 9f4e2dcc2e Aggiorna la dimensione della cella da 20 a 40, modifica il ritardo di rendering da 10 a 30 ms e centra la finestra di gioco 2024-12-16 00:14:50 +01:00
Matteo Benedetto d3936b5723 Riduci il ritardo di rendering da 50 a 10 ms, modifica il numero di ratti generati da 50 a 5 e aggiorna la tolleranza di sovrapposizione in base alla dimensione della cella 2024-12-15 22:02:57 +01:00
Matteo Benedetto 0817b9143c Aumenta il numero di ratti generati da 5 a 50 nel gioco MiceMaze 2024-12-15 21:25:17 +01:00
Matteo Benedetto 06c02ec17e Riduci la dimensione della cella da 40 a 20 nel gioco MiceMaze 2024-12-15 20:43:20 +01:00
Matteo Benedetto 51d9d5b1c8 Aggiungi il log delle dimensioni dello schermo e modifica la dimensione della cella nel gioco MiceMaze 2024-12-15 20:40:16 +01:00
Matteo Benedetto 05c07e30f6 Abilita l'audio nel gioco MiceMaze 2024-12-15 19:04:45 +01:00
Matteo Benedetto 3ccffdca7d Modifica il sistema di rendering SDL e migliora la gestione delle unità nel gioco 2024-12-15 18:56:51 +01:00