summaryrefslogtreecommitdiff
path: root/src/entity.c
diff options
context:
space:
mode:
authorkdx <kikoodx@paranoici.org>2023-03-17 13:45:20 +0100
committerkdx <kikoodx@paranoici.org>2023-03-17 13:46:20 +0100
commitf3f3100dbd1f8ff31c3e6fd2acfd2c6edffcc181 (patch)
treeee2d07262e282120eb1776f3491272c91336e8eb /src/entity.c
parentb6e8281daa60e60e2ae81569b5547f1e3ac3a72b (diff)
downloadhyperultra-f3f3100dbd1f8ff31c3e6fd2acfd2c6edffcc181.tar.gz
cringe
Diffstat (limited to 'src/entity.c')
-rw-r--r--src/entity.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/entity.c b/src/entity.c
index da7662e..94c0a47 100644
--- a/src/entity.c
+++ b/src/entity.c
@@ -1,5 +1,6 @@
#include "entity.h"
#include "game.h"
+#include "map.h"
#include "cfg.h"
bool
@@ -10,7 +11,8 @@ entity_collide(Entity *this, Game *g, int ox, int oy)
const int y0 = this->pos[1] - this->height / 2 + oy;
const int x1 = x0 + this->width - 1;
const int y1 = y0 + this->height - 1;
- return (x0 < 0 || y0 < 0 || x1 >= DISPLAY_WIDTH || y1 >= DISPLAY_HEIGHT);
+ return (map_get_px(x0, y0) == '0' || map_get_px(x0, y1) == '0' ||
+ map_get_px(x1, y0) == '0' || map_get_px(x1, y1) == '0');
}
void