From d8563328cc308ff5217676d8b9cc2e0efa193fc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Mangano-Tarumi?= Date: Sat, 5 Aug 2017 17:07:25 +0200 Subject: [PATCH] ability to click on hit objects --- src/game.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/game.c b/src/game.c index be993c1..e08649c 100644 --- a/src/game.c +++ b/src/game.c @@ -79,6 +79,8 @@ static struct oshu_hit* find_hit(struct oshu_game *game, int x, int y) */ static void hit(struct oshu_game *game) { + if (game->paused) + return; int x, y; oshu_get_mouse(game->display, &x, &y); int now = game->audio->current_timestamp * 1000; @@ -126,6 +128,9 @@ static void handle_event(struct oshu_game *game, SDL_Event *event) else if (event->key.keysym.sym == SDLK_ESCAPE) toggle_pause(game); break; + case SDL_MOUSEBUTTONDOWN: + hit(game); + break; } }