generated from mwc/project_game
@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
This commit is contained in:
Binary file not shown.
Binary file not shown.
7
fruit.py
7
fruit.py
@@ -23,7 +23,7 @@ class Fruit:
|
||||
if y == 24:
|
||||
game.remove_agent(self)
|
||||
else:
|
||||
catcher = game.get_agent_by_name('catcher')
|
||||
catcher = game.get_agent_by_name("Player")
|
||||
new_position = (x, y + 1)
|
||||
if new_position == catcher.position:
|
||||
catcher.explode()
|
||||
@@ -50,14 +50,15 @@ class Fruit:
|
||||
if y == HEIGHT - 1:
|
||||
game.remove_agent(self)
|
||||
else:
|
||||
ship = game.get_agent_by_name('ship')
|
||||
new_position = (x, y + 1)
|
||||
ship = game.get_agent_by_name("Player")
|
||||
new_position = (x, y - 1)
|
||||
if new_position == ship.position:
|
||||
ship.explode()
|
||||
game.end()
|
||||
else:
|
||||
self.position = new_position
|
||||
|
||||
|
||||
class FruitSpawner:
|
||||
display = False
|
||||
|
||||
|
||||
2
poetry.lock
generated
2
poetry.lock
generated
@@ -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]]
|
||||
name = "ansicon"
|
||||
|
||||
Reference in New Issue
Block a user