Implement GameWindow class with SDL2 integration for rendering, audio, and input handling

- Added GameWindow class to manage game window creation and rendering.
- Integrated SDL2 for window management, rendering, and audio playback.
- Implemented methods for loading images, creating textures, and drawing graphics.
- Added font management for dynamic text rendering.
- Included input handling for keyboard, mouse, and joystick events.
- Implemented a main game loop to handle updates and rendering.
- Added support for special effects like white flash and blood splatter.
- Created utility methods for managing game state and performance.
This commit is contained in:
John Doe
2025-10-17 22:54:55 +02:00
parent 3812d36cd6
commit 576c633be5
22 changed files with 1894 additions and 3180 deletions
Binary file not shown.
Binary file not shown.
+1 -1
View File
@@ -80,7 +80,7 @@ class Rat(Unit):
units.extend(self.game.unit_positions.get(self.position, []))
for unit in units:
if unit.id == self.id or unit.age < AGE_THRESHOLD or self.position != unit.position_before:
if unit.id == self.id or unit.age < AGE_THRESHOLD:
continue
x1, y1, x2, y2 = self.bbox
ox1, oy1, ox2, oy2 = unit.bbox