collisions happen properly now

This commit is contained in:
Priec
2025-11-18 01:02:13 +01:00
parent 967b377e76
commit dd410c6f6c
6 changed files with 74 additions and 54 deletions

View File

@@ -31,8 +31,8 @@ static const char **OBSTACLE_CRAWL_FRAMES[] = { OBSTACLE_CRAWL1_FRAME, OBSTACLE_
// Crawl1 dimensions and collision
static const int OBSTACLE_CRAWL1_FRAME_HEIGHT = sizeof(OBSTACLE_CRAWL1_FRAME) / sizeof(OBSTACLE_CRAWL1_FRAME[0]);
static const int OBSTACLE_CRAWL1_FRAME_WIDTH = std::strlen(OBSTACLE_CRAWL1_FRAME[0]);
static const int OBSTACLE_CRAWL1_COLLISION_LEFT_OFFSET = 0;
static const int OBSTACLE_CRAWL1_COLLISION_RIGHT_OFFSET = 0;
static const int OBSTACLE_CRAWL1_COLLISION_LEFT_OFFSET = 3;
static const int OBSTACLE_CRAWL1_COLLISION_RIGHT_OFFSET = 3;
static const int OBSTACLE_CRAWL1_COLLISION_WIDTH = OBSTACLE_CRAWL1_FRAME_WIDTH - (OBSTACLE_CRAWL1_COLLISION_LEFT_OFFSET + OBSTACLE_CRAWL1_COLLISION_RIGHT_OFFSET);
static const int OBSTACLE_CRAWL1_COLLISION_TOP_OFFSET = 4; // first 4 rows are just empty ('.')
// collision box height = bottom 2 rows