xlib_playground

Xlib playground for experiments.
Log | Files | Refs

commit a6e39068f5c5760c4738b1eeff3e791d17f784c4
parent ecccc1828858be4c580e1c5960acc1cc71fbe33c
Author: Matsuda Kenji <info@mtkn.jp>
Date:   Sat, 24 Dec 2022 14:57:28 +0900

change square size and number

Diffstat:
Mex4/ex4.c | 8++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/ex4/ex4.c b/ex4/ex4.c @@ -12,7 +12,7 @@ #define INIT_HEIGHT (600) #define FPS (60) #define SUB_TICK (4) -#define NUM_SQUARE (40) +#define NUM_SQUARE (30) #define max(a, b) ((a) > (b) ? (a) : (b)) #define min(a, b) ((a) < (b) ? (a) : (b)) @@ -333,10 +333,10 @@ game_play(void) struct timespec ts; for(int i = 0; i < NUM_SQUARE; i++){ - square[i].ppx = square[i].px = 10 * (i + 1); + square[i].ppx = square[i].px = 20 * (i + 1); square[i].ppy = square[i].py = 100; square[i].vx = square[i].vy = 0; - square[i].w = square[i].h = 10; + square[i].w = square[i].h = 20; } while (next_menu == GAME_PLAY){ @@ -390,7 +390,7 @@ game_play(void) win_width, win_height, // width and height False); for (int i = 0; i < NUM_SQUARE; i++) { - XFillRectangle(display, window, sgc[i], + XDrawRectangle(display, window, sgc[i], square[i].px, square[i].py, // position square[i].w, square[i].h); // width and height }