xlib_playground

Xlib playground for experiments.
Log | Files | Refs

commit c3e6f47599470632fc0e04587209f810d6c42475
parent 3db362e3b97891f03bd37a0ad70db435e49d2575
Author: Matsuda Kenji <info@mtkn.jp>
Date:   Fri, 13 Jan 2023 11:00:25 +0900

rename SUB_TICK to SUB_FRAME

Diffstat:
Mex9/main.c | 9++++-----
1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/ex9/main.c b/ex9/main.c @@ -17,7 +17,7 @@ /* constants */ enum { FPS = 60, - SUB_TICK = 4, + SUB_FRAME = 4, GRAVITY = 1000, WIN_WIDTH = 800, WIN_HEIGHT = 600, @@ -54,8 +54,7 @@ enum debug_msg { /* variables */ enum next_menu next_menu = START_MENU; -void (* col_func[NUM_OBJ_TYPE][NUM_OBJ_TYPE])(Object *, - Object *); +void (* col_func[NUM_OBJ_TYPE][NUM_OBJ_TYPE])(Object *, Object *); /* function prototypes */ /* menus */ @@ -208,9 +207,9 @@ game_play(void) clock_gettime(CLOCK_MONOTONIC, &ts); t0 = ts.tv_nsec; - for (int k = 0; k < SUB_TICK; k++) { + for (int k = 0; k < SUB_FRAME; k++) { // TODO: should be done for ol - next_tick(player, 1e9 / FPS / SUB_TICK); + next_tick(player, 1e9 / FPS / SUB_FRAME); // game over when fall out of the world if (player->p.y > WORLD_HEIGHT * BLOCK_SIZE) {