This commit is contained in:
Filipriec
2025-11-20 16:45:50 +01:00
parent dd410c6f6c
commit 3e47f855ed
6 changed files with 8 additions and 16 deletions

View File

@@ -5,7 +5,7 @@
#include "../assets/character_run_frames.h"
#include "../assets/character_crawl_frames.h"
// Simple obstacle representation
// Obstacle representation
struct Obstacle {
int x;
int y;
@@ -48,7 +48,7 @@ inline bool check_collision(const CharacterPosition& player,
break;
}
// Player's bounding box
// Player bounding box
const int player_left = box_x;
const int player_right = player_left + box_w;
const int player_top = player_bottom + box_h;
@@ -59,7 +59,7 @@ inline bool check_collision(const CharacterPosition& player,
const int obs_bottom = obs.y;
const int obs_top = obs_bottom + obs.height;
// Simple overlap check
// Overlap check
bool horizontal = player_left < obs_right && player_right > obs_left;
bool vertical = player_bottom < obs_top && player_top > obs_bottom;
return horizontal && vertical;