Created
September 9, 2021 23:53
-
-
Save nasajpledu/ae68b1b93d3698f932400bed33f196d7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# End game if collision between player and enemy or treasure | |
# Close game if we lose and restart game loop if we win | |
if player.detect_collision(enemy_0): | |
is_game_over = True | |
did_win = False | |
text = font.render('You Lose!', True, BLACK_COLOR) | |
self.game_screen.blit(text, (275, 350)) | |
pygame.display.update() | |
clock.tick(1) | |
break | |
elif player.detect_collision(dest): | |
is_game_over = True | |
did_win = True | |
text = font.render('You Win!', True, BLACK_COLOR) | |
self.game_screen.blit(text, (275, 350)) | |
pygame.display.update() | |
clock.tick(1) | |
break |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment