xlib_playground

Xlib playground for experiments.
Log | Files | Refs

commit f22c0e4a778cec855691d29c2498d5d8b8f2a58f
parent 24047621832f05a5cebbb2ae62b7a5f76ce9f61a
Author: Matsuda Kenji <info@mtkn.jp>
Date:   Mon,  9 Jan 2023 15:06:52 +0900

change to use general collision function

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

diff --git a/ex9/main.c b/ex9/main.c @@ -232,10 +232,7 @@ game_play(void) // collision aganst the goal flag for (olp = fl; olp != NULL; olp = olp->next){ - if (test_collision(player, olp->o)) { - next_menu = GAME_CLEAR; - break; - } + handle_collision(player, olp->o); } } @@ -424,6 +421,8 @@ handle_inputs(enum key_state key_state[]) } void col_pf(struct Object *o0, struct Object *o1) { + if (!test_collision(o0, o1)) + return; handle_collision_mf(o0, o1); next_menu = GAME_CLEAR; }