diff --git a/demo2.cpp b/demo2.cpp index 83ca4b7..1f8b4ea 100644 --- a/demo2.cpp +++ b/demo2.cpp @@ -39,6 +39,10 @@ memory and turning can be less precise (can be seen a lot with 64 item 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 HEAD_BOB_HEIGHT 200 #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 && 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; }