Update impassable tiles
This commit is contained in:
parent
8397666cb2
commit
dab37ddeff
15
app/main.c
15
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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user