generated from mwc/project_game
Rename state values to lowercase
This commit is contained in:
@@ -55,8 +55,8 @@ class Fruit:
|
||||
game.remove_agent(piece)
|
||||
game.remove_agent(self)
|
||||
self.alive = False
|
||||
game.state['Lives'] -= 1
|
||||
if game.state['Lives'] <= 0:
|
||||
game.state['lives'] -= 1
|
||||
if game.state['lives'] <= 0:
|
||||
game.end()
|
||||
else:
|
||||
self.position = (new_x, new_y)
|
||||
@@ -81,7 +81,7 @@ class Fruit:
|
||||
catcher_positions = {p.position for p in catcher.pieces}
|
||||
for piece in self.pieces.values():
|
||||
if piece.position in catcher_positions:
|
||||
game.state['Score'] += 1
|
||||
game.state['score'] += 1
|
||||
for p in self.pieces.values():
|
||||
game.remove_agent(p)
|
||||
game.remove_agent(self)
|
||||
|
||||
Reference in New Issue
Block a user