Skip to content

Commit

Permalink
Add screen tap event
Browse files Browse the repository at this point in the history
  • Loading branch information
sourabhv committed Jun 16, 2023
1 parent 6176e5c commit 8108b2a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions flappy.py
Original file line number Diff line number Diff line change
Expand Up @@ -510,9 +510,11 @@ def getHitmask(image):

def tap(event):
left, _, _ = pygame.mouse.get_pressed()
return left or (
event.type == KEYDOWN and (event.key == K_SPACE or event.key == K_UP)
space_or_up = event.type == KEYDOWN and (
event.key == K_SPACE or event.key == K_UP
)
screen_tap = event.type == pygame.FINGERDOWN
return left or space_or_up or screen_tap


if __name__ == "__main__":
Expand Down

0 comments on commit 8108b2a

Please sign in to comment.