commit 2710f2dc89d7c020e1adf7771ae0f63b4ff9f8b3 parent 7e76887fcbdb19c3d0bbc893a1b320d56ecb51d2 Author: Matsuda Kenji <info@mtkn.jp> Date: Tue, 3 Jan 2023 08:02:41 +0900 make window small Diffstat:
M | ex4/ex4.c | | | 12 | ++++++------ |
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/ex4/ex4.c b/ex4/ex4.c @@ -8,11 +8,11 @@ #include <X11/Xlib.h> /* macros */ -#define INIT_WIDTH (800) -#define INIT_HEIGHT (600) +#define INIT_WIDTH (250) +#define INIT_HEIGHT (200) #define FPS (60) #define SUB_TICK (4) -#define NUM_SQUARE (500) +#define NUM_SQUARE (100) #define max(a, b) ((a) > (b) ? (a) : (b)) #define min(a, b) ((a) < (b) ? (a) : (b)) @@ -376,9 +376,9 @@ game_play(void) for(int i = 0; i < NUM_SQUARE; i++){ square[i].ppx = square[i].px = (float)rand() * win_width / RAND_MAX; square[i].ppy = square[i].py = (float)rand() * win_height / RAND_MAX; - square[i].vx = (float)rand() * 300 / RAND_MAX - 150; - square[i].vy = (float)rand() * 300 / RAND_MAX - 150; - square[i].w = square[i].h = (float)rand() * 30 / RAND_MAX; + square[i].vx = (float)rand() * 100 / RAND_MAX - 50; + square[i].vy = (float)rand() * 100 / RAND_MAX - 50; + square[i].w = square[i].h = (float)rand() * 10 / RAND_MAX; }