Skip to content

Commit

Permalink
ability to click on hit objects
Browse files Browse the repository at this point in the history
  • Loading branch information
fmang committed Aug 5, 2017
1 parent 7d983ea commit d856332
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/game.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
}

Expand Down

0 comments on commit d856332

Please sign in to comment.