From 9a01ec8b6b5ef46c450ab3649caa5d9c7baa19a3 Mon Sep 17 00:00:00 2001 From: KikooDX Date: Thu, 14 May 2020 17:51:16 +0200 Subject: [PATCH] define for FPS, set to 50 --- JTMM.g3a | Bin 76032 -> 76032 bytes include/shared_define.h | 1 + src/draw.c | 4 ++-- src/main.c | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/JTMM.g3a b/JTMM.g3a index 44f5fc694d319b1be3b3eb967b1628542f69c103..19af671e833158552cbc84df4f93e6c4cf49c685 100644 GIT binary patch delta 162 zcmV;T0A2rp(gc9g1dt*Er#rDEBmn|6IkQm#YYmfN0SB|Z4$o~hGEX8j6@T>B3+Dg< z3grMn2|)<~Cm#{f2m%@}643`VC?7&W3*-QQ3{NHi3jhfK2~q2XACtg*7a1}yrs)7L zw(0;23NOa&0Wa3=0ZR!l=1U2a@O+#EQR{^tvygob1OiSVv!H>pTLDy)-`ysY&E1QW Qu-!TVbhAI+ze)n9J7cIhG5`Po delta 166 zcmZp;#L{qyWr7mZs@WS=R2Z3z3^oTcX7f%?U}WFChwpr@>2H4}6VduF*SMcEFmgR* zaMXQdBQMCPevyMoN?+(AyNQOplOy*NhI$@C!-< 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();