diff --git a/JTMM.g3a b/JTMM.g3a index 44f5fc6..19af671 100644 Binary files a/JTMM.g3a and b/JTMM.g3a differ diff --git a/include/shared_define.h b/include/shared_define.h index 3ebb9a0..849dce1 100644 --- a/include/shared_define.h +++ b/include/shared_define.h @@ -2,3 +2,4 @@ #define PLAYER_W 11 #define LEVEL_WIDTH 28 #define LAST_LEVEL 5062 +#define FPS 50 diff --git a/src/draw.c b/src/draw.c index edd61b1..7f48ff6 100644 --- a/src/draw.c +++ b/src/draw.c @@ -122,7 +122,7 @@ void erase_tile(int x, int y, char level[]) void draw_timer(unsigned int step) { - dprint(0, 0, C_WHITE, C_BLACK, "%u.%02u", step/60, step%60); + dprint(0, 0, C_WHITE, C_BLACK, "%u.%02u", step/FPS, step%FPS); } void just_breathe(unsigned int step) @@ -135,7 +135,7 @@ void just_breathe(unsigned int step) { dclear(0); dtext(x, y, "Thank you for playing", C_WHITE, C_BLACK); - dprint(x, y + 12, C_WHITE, C_BLACK, "%u.%02u", step/60, step%60); + dprint(x, y + 12, C_WHITE, C_BLACK, "%u.%02u", step/FPS, step%FPS); dupdate(); x += xspd; y += yspd; diff --git a/src/main.c b/src/main.c index 7d88e0e..9c8cbbb 100644 --- a/src/main.c +++ b/src/main.c @@ -64,7 +64,7 @@ int main(void) player_x = start_x; player_y = start_y; //fps cap timer - timer_setup(0, timer_delay(0, 16667), 0, callback, &has_ticked); + timer_setup(0, timer_delay(0, 1000000/FPS), 0, callback, &has_ticked); timer_start(0); while (game_loop) { while(!has_ticked) sleep();