Update impassable tiles

This commit is contained in:
Camden Dixie O'Brien 2024-12-31 20:07:37 +00:00
parent 8397666cb2
commit dab37ddeff

View File

@ -91,7 +91,10 @@ static unsigned map[MAPNLAYERS][MAPWIDTH][MAPHEIGHT];
static SDL_Texture *tstex, *pidle, *pwalk; static SDL_Texture *tstex, *pidle, *pwalk;
static input_state_t input; static input_state_t input;
static dvec_t vpos = { -128, -96 }; 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) static inline double mag(dvec_t v)
{ {
@ -115,11 +118,13 @@ static inline unsigned tileat(int layeridx, double x, double y)
static inline bool tilepassable(int x, int y) static inline bool tilepassable(int x, int y)
{ {
const unsigned id = tileat(0, x, y); for (unsigned l = 0; l < MAPNLAYERS; ++l) {
const unsigned id = tileat(l, x, y);
for (unsigned i = 0; i < NELEMS(impassable); ++i) { for (unsigned i = 0; i < NELEMS(impassable); ++i) {
if (impassable[i] == id) if (impassable[i] == id)
return false; return false;
} }
}
return true; return true;
} }