Compare commits

...

2 Commits

Author SHA1 Message Date
kdang
298a5fc58c Merge branch 'main' of https://git.makingwithcode.org/kdang/project_game 2025-12-18 09:35:07 -05:00
kdang
f80e4dca48 @Chris, If you run the game.py file and dont move
for a few seconds you get a crash. We also cannot
figure out how to make the fruit fall. please take
a look at the crash and tell us how to make the
fruit fall. Thank you!-Conor
2025-12-17 09:39:29 -05:00
4 changed files with 5 additions and 4 deletions

Binary file not shown.

Binary file not shown.

View File

@@ -23,7 +23,7 @@ class Fruit:
if y == 24: if y == 24:
game.remove_agent(self) game.remove_agent(self)
else: else:
catcher = game.get_agent_by_name('catcher') catcher = game.get_agent_by_name("Player")
new_position = (x, y + 1) new_position = (x, y + 1)
if new_position == catcher.position: if new_position == catcher.position:
catcher.explode() catcher.explode()
@@ -50,14 +50,15 @@ class Fruit:
if y == HEIGHT - 1: if y == HEIGHT - 1:
game.remove_agent(self) game.remove_agent(self)
else: else:
ship = game.get_agent_by_name('ship') ship = game.get_agent_by_name("Player")
new_position = (x, y + 1) new_position = (x, y - 1)
if new_position == ship.position: if new_position == ship.position:
ship.explode() ship.explode()
game.end() game.end()
else: else:
self.position = new_position self.position = new_position
class FruitSpawner: class FruitSpawner:
display = False display = False

2
poetry.lock generated
View File

@@ -1,4 +1,4 @@
# This file is automatically @generated by Poetry 2.1.3 and should not be changed by hand. # This file is automatically @generated by Poetry 2.2.0 and should not be changed by hand.
[[package]] [[package]]
name = "ansicon" name = "ansicon"