From dab37ddefff08edbf9057dc7e422f9dadc08c9be Mon Sep 17 00:00:00 2001 From: Camden Dixie O'Brien Date: Tue, 31 Dec 2024 20:07:37 +0000 Subject: [PATCH] Update impassable tiles --- app/main.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/app/main.c b/app/main.c index 699d264..8380237 100644 --- a/app/main.c +++ b/app/main.c @@ -91,7 +91,10 @@ static unsigned map[MAPNLAYERS][MAPWIDTH][MAPHEIGHT]; static SDL_Texture *tstex, *pidle, *pwalk; static input_state_t input; static dvec_t vpos = { -128, -96 }; -static const unsigned impassable[] = { 284 }; +static const unsigned impassable[] = { + 284, 485, 486, 525, 527, 566, 567, 731, + 768, 770, 771, 804, 805, 806, 808, 845, +}; static inline double mag(dvec_t v) { @@ -115,10 +118,12 @@ static inline unsigned tileat(int layeridx, double x, double y) static inline bool tilepassable(int x, int y) { - const unsigned id = tileat(0, x, y); - for (unsigned i = 0; i < NELEMS(impassable); ++i) { - if (impassable[i] == id) - return false; + for (unsigned l = 0; l < MAPNLAYERS; ++l) { + const unsigned id = tileat(l, x, y); + for (unsigned i = 0; i < NELEMS(impassable); ++i) { + if (impassable[i] == id) + return false; + } } return true; }