commit 1cd22fb31d384d84b6965ca07312f8e7af1eb6c9 parent 2710f2dc89d7c020e1adf7771ae0f63b4ff9f8b3 Author: Matsuda Kenji <info@mtkn.jp> Date: Tue, 3 Jan 2023 08:12:38 +0900 ex5: make window small Diffstat:
M | ex5/ex5.c | | | 12 | ++++++------ |
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/ex5/ex5.c b/ex5/ex5.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_CIRCLE (100) +#define NUM_CIRCLE (50) #define max(a, b) ((a) > (b) ? (a) : (b)) #define min(a, b) ((a) < (b) ? (a) : (b)) @@ -475,9 +475,9 @@ game_play(void) for(int i = 0; i < NUM_CIRCLE; i++){ circle[i].ppx = circle[i].px = rand() * (float)win_width / (float)RAND_MAX; circle[i].ppy = circle[i].py = rand() * (float)win_height / (float)RAND_MAX; - circle[i].vx = rand() * 300.0 / (float)RAND_MAX - 150; - circle[i].vy = rand() * 300.0 / (float)RAND_MAX - 150; - circle[i].r = rand() * 30.0 / (float)RAND_MAX + 5; + circle[i].vx = rand() * 100.0 / (float)RAND_MAX - 50; + circle[i].vy = rand() * 100.0 / (float)RAND_MAX - 50; + circle[i].r = rand() * 10.0 / (float)RAND_MAX; circle[i].m = circle[i].r * circle[i].r; }