Commit Graph

72 Commits

Author SHA1 Message Date
Matteo Benedetto 2ad6a082b3 Normalize near-white pixels to pure white in all loaded assets
Assets like lose.png contain thousands of (254,254,254) pixels on a
background that is also white. When drawn on a white panel these
near-white pixels are slightly darker, producing a visible gray seam.

Apply a global normalization in load_image(): any opaque pixel with
R=G=B >= 250 is clamped to (255,255,255). Applied to every asset, not
only those with transparent_color, so the background is always pure
white regardless of off-by-one in the source PNG.
2026-06-17 11:13:40 +02:00
Matteo Benedetto 2eccf504f5 Add semi-transparent tunnel cover overlay for internal passages
- Add sdl2.create_overlay_texture() and draw_overlay_texture(alpha) for
  transparent full-map overlays built from sub-tile surface blits.
- Add Graphics.regenerate_tunnel_cover() which builds an overlay of
  4 random grass sub-tiles (20x20) for every internal tunnel cell,
  defined as a tunnel cell surrounded by occupied cells (wall or
  tunnel) on all four sides. Cells with at least one open side are
  handled by cave_foreground and skipped here.
- Draw the tunnel cover in the game loop after top-layer units/effects
  but before cave_foreground and points, at 95% opacity (alpha=242)
  so the unit and effect passing underneath is just barely visible.
2026-06-16 23:06:17 +02:00
John Doe c7ff5ae4cf Refactor code structure for improved readability and maintainability 2026-05-09 16:35:25 +02:00
John Doe d9d7a4ac82 Update keybindings and enhance loading screen functionality
- Refactor keybindings for gas spawning across multiple configurations
- Implement new loading screen updates during game initialization
- Add tests to ensure all weapon actions are exposed in keybinding profiles
- Introduce new assets for explosion effects
2026-05-09 13:29:32 +02:00
John Doe 310dc0dca9 Add DAT finale flow, editor, and new soundtrack assets 2026-05-09 12:03:17 +02:00
John Doe d32d2cd79c Refine start menu difficulty and preview workflow 2026-05-08 18:26:55 +02:00
John Doe f1770b218c Add animated start menu and level music config 2026-05-07 23:18:39 +02:00
John Doe 2367f4fb1c Add menu audio controls and menu music 2026-05-07 20:35:15 +02:00
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 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
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 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 302d454783 Enhance joystick handling in KeyLogger by adding button release and axis motion events 2025-08-19 16:30:52 +02:00
Matteo Benedetto 3fa678507c Fix window display by enabling window show and presenting the renderer in GameWindow 2025-08-19 16:23:06 +02:00
Matteo Benedetto 947d464afd Fix window display initialization in KeyLogger and MiceMaze 2025-08-19 16:04:38 +02:00
Matteo Benedetto 79eb8c2de6 Log keycodes to a file on key press events 2025-08-19 12:34:06 +02:00
Matteo Benedetto 8a32aad877 OK 2025-08-17 18:49:07 +02:00
Matteo Benedetto f4ca5bba5b Enhance rendering system: improve screen resolution handling, add audio system initialization, and refine blood surface generation and blending 2025-08-14 17:29:58 +02:00
Matteo Benedetto a4b6703d12 Enhance blood stain handling: combine existing and new blood surfaces for better accumulation and add surface management 2025-08-13 23:50:21 +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 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 d31de92758 Rimuovi parametri non necessari dalla riproduzione audio e semplifica la gestione delle posizioni del testo 2024-12-28 12:03:01 +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 8b3ad61047 Correggi la variabile di ambiente RESOLUTION e aggiorna il disegno dello sfondo per considerare gli offset 2024-12-26 00:33:23 +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 3ee958b235 Aggiungi supporto per la pausa tramite un nuovo tasto nella classe KeyBindings 2024-12-23 17:03:23 +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 ae0a088011 Modifica il percorso di caricamento delle immagini nella classe GameWindow; aggiungi file di configurazione per PyInstaller 2024-12-23 12:55:34 +01:00
Matteo Benedetto 7a21d4cb42 Aggiorna la gestione della risoluzione e ottimizza il disegno delle immagini nella classe GameWindow; aggiungi scores.txt al .gitignore 2024-12-23 01:39:20 +01:00
Matteo Benedetto 5b97f25cdf Modifica la posizione di disegno dell'immagine nella classe GameWindow per migliorare l'allineamento 2024-12-23 01:19:33 +01:00
Matteo Benedetto 43e7b143d9 Modifica la dimensione del font nel metodo pause_screen in base alla dimensione del target 2024-12-23 01:18:19 +01:00
Matteo Benedetto 65356a5eaf Ottimizza la gestione della dimensione dello schermo nella classe GameWindow 2024-12-23 01:09:28 +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 8cffd7591a Rimuovi l'inizializzazione audio dalla classe GameWindow 2024-12-22 18:49:07 +01:00
Matteo Benedetto c6589caaa4 Rimuovi l'inizializzazione audio dalla classe GameWindow 2024-12-22 18:45:08 +01:00
Matteo Benedetto 7c772f4964 Rimuovi la duplicazione dell'inizializzazione audio nella finestra di gioco 2024-12-22 18:41:32 +01:00