Skip to content

Commit

Permalink
Merge pull request #114 from ItsKareem/main
Browse files Browse the repository at this point in the history
Bonnie's Sweet Buffet.. again?
  • Loading branch information
acornitum authored Feb 4, 2025
2 parents a3d9128 + 5e57766 commit 064ff9e
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions pets/bonnies_sweet_buffet/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,12 +208,13 @@ def display_end():
bombs.clear()
strawberries.clear()
goldberries.clear()
if 'dead' in globals():
if dead in splash:
splash.remove(dead)
if 'end' in globals():
if end in splash:
splash.remove(end)
game_over = False
state = 0
count = 0

keys = pygame.key.get_pressed()

Expand All @@ -231,7 +232,6 @@ def display_end():

if current_time - last_collection_time > timeout_duration:
state = 0
bonnie_sprite[0] = direction + state

# Move bombs and check for collisions
for bomb in bombs:
Expand All @@ -253,6 +253,7 @@ def display_end():
splash.remove(strawberry)
strawberries.remove(strawberry)
elif check_collision(bonnie_sprite, strawberry):
timeout_duration = 2000
last_collection_time = pygame.time.get_ticks()
state = 2
count += 1
Expand All @@ -266,6 +267,7 @@ def display_end():
splash.remove(goldberry)
goldberries.remove(goldberry)
elif check_collision(bonnie_sprite, goldberry):
timeout_duration = 2000
last_collection_time = pygame.time.get_ticks()
state = 2
count += 3
Expand All @@ -276,6 +278,9 @@ def display_end():
if count >= 100:
count = 100
progress = 10
timeout_duration = 999999
last_collection_time = pygame.time.get_ticks()
state = 2
game_over = True
display_end()
elif count >= 90:
Expand Down

0 comments on commit 064ff9e

Please sign in to comment.