commit 6e1613e4a1712c9b3b8dc9aea3206e0a236e1a9d parent 0e9d36b4d1477c6c470d9602f17266d2fc9aacdf Author: Matsuda Kenji <info@mtkn.jp> Date: Sun, 1 Jan 2023 17:18:47 +0900 fix bug Diffstat:
M | ex8/main.c | | | 4 | ++-- |
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/ex8/main.c b/ex8/main.c @@ -325,13 +325,13 @@ handle_inputs(enum key_state key_state[]) next_menu = GAME_OVER; return; } - if (key_state[KEY_D] == KEY_DOWN && key_state[KEY_A] == KEY_UP) { + if (key_state[KEY_D] == KEY_DOWN && key_state[KEY_A] != KEY_DOWN) { if (player->v.x > 0) { player->a.x = 500; } else { player->a.x = 1000; } - } else if (key_state[KEY_A] == KEY_DOWN && key_state[KEY_D] == KEY_UP) { + } else if (key_state[KEY_A] == KEY_DOWN && key_state[KEY_D] != KEY_DOWN) { if (player->v.x > 0) { player->a.x = -1000; } else {