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:
Binary file not shown.
Binary file not shown.
+1
-1
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user