define for FPS, set to 50

This commit is contained in:
KikooDX 2020-05-14 17:51:16 +02:00
parent b36693a16c
commit 9a01ec8b6b
4 changed files with 4 additions and 3 deletions

BIN
JTMM.g3a

Binary file not shown.

View File

@ -2,3 +2,4 @@
#define PLAYER_W 11
#define LEVEL_WIDTH 28
#define LAST_LEVEL 5062
#define FPS 50

View File

@ -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;

View File

@ -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();