|
|
@ -23,12 +23,12 @@ uint8_t get_tile_coord(uint8_t pixel_coord) { |
|
|
|
} |
|
|
|
|
|
|
|
uint8_t player_bg_collides(void) { |
|
|
|
const int8_t map_x = PLAYER.x / 8 + MAP.camera_x; |
|
|
|
const int8_t map_x = get_tile_coord(PLAYER.x) + MAP.camera_x; |
|
|
|
if (map_x < 0 || map_x + 1 >= MAP.map_width) { |
|
|
|
return 1; |
|
|
|
} |
|
|
|
|
|
|
|
const int8_t map_y = PLAYER.y_hi / 8 + MAP.camera_y; |
|
|
|
const int8_t map_y = get_tile_coord(PLAYER.y_hi) + MAP.camera_y; |
|
|
|
if (map_y < 0 || map_y + 1 >= MAP.map_height) { |
|
|
|
return 1; |
|
|
|
} |
|
|
|