Improve door

This commit is contained in:
Miloslav Číž 2018-09-15 12:01:38 +02:00
parent 55ff278ede
commit 05f8086400

View file

@ -39,6 +39,10 @@
memory and turning can be less precise (can be seen a lot with 64 item memory and turning can be less precise (can be seen a lot with 64 item
LUT). */ LUT). */
#define DOOR_ROLL_SIGN -1
/* ^ Defines how the door roll: -1 opens the door to the left, 1 to the
right, 0 to both. */
#define FPS 60 #define FPS 60
#define HEAD_BOB_HEIGHT 200 #define HEAD_BOB_HEIGHT 200
#define HEAD_BOB_STEP 20 #define HEAD_BOB_STEP 20
@ -902,7 +906,7 @@ Unit rollAt(int16_t x, int16_t y)
if (x >= 0 && x < LEVEL_X_RES && y >= 0 && y < LEVEL_Y_RES && if (x >= 0 && x < LEVEL_X_RES && y >= 0 && y < LEVEL_Y_RES &&
level[(LEVEL_Y_RES - y -1) * LEVEL_X_RES + x] == 6) level[(LEVEL_Y_RES - y -1) * LEVEL_X_RES + x] == 6)
return (pokitto.frameCount * 10) % UNITS_PER_SQUARE; return sinInt(pokitto.frameCount * 10) + DOOR_ROLL_SIGN * UNITS_PER_SQUARE;
return 0; return 0;
} }