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:
|
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
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]]
|
[[package]]
|
||||||
name = "ansicon"
|
name = "ansicon"
|
||||||
|
|||||||
Reference in New Issue
Block a user