Allow walking through doors

This commit is contained in:
Miloslav Číž 2018-09-15 11:19:28 +02:00
parent d748874c08
commit 6696389ca4

View file

@ -774,6 +774,12 @@ Unit floorHeightAt(int16_t x, int16_t y)
return UNITS_PER_SQUARE * 2;
}
Unit collisionAt(int16_t x, int16_t y)
{
Unit square = level[(LEVEL_Y_RES - y -1) * LEVEL_X_RES + x];
return square == 0 || square == 6 ? 0 : UNITS_PER_SQUARE;
}
Unit textureAt(int16_t x, int16_t y)
{
Unit t = 0;
@ -963,7 +969,7 @@ int main()
}
player.update(moveDirection,strafe,rotationDirection,false,0,
floorHeightAt,0,false,dt);
collisionAt,0,false,dt);
}
}