generated from mwc/project_game
im stuck as the same place as last time lol
This commit is contained in:
Binary file not shown.
Binary file not shown.
3
frog.py
3
frog.py
@@ -14,7 +14,8 @@ class Frog:
|
|||||||
if keystroke.name == "KEY_RIGHT":
|
if keystroke.name == "KEY_RIGHT":
|
||||||
new_position = (x + 1, y)
|
new_position = (x + 1, y)
|
||||||
if keystroke.name == "KEY_UP":
|
if keystroke.name == "KEY_UP":
|
||||||
new_position = (x, y + 1)
|
froggy = game.get_agent_by_name('froggy')
|
||||||
|
froggy.position = (froggy.position[0], froggy.position[1]+1)
|
||||||
if game.on_board(new_position):
|
if game.on_board(new_position):
|
||||||
if game.is_empty(new_position):
|
if game.is_empty(new_position):
|
||||||
self.position = new_position
|
self.position = new_position
|
||||||
|
|||||||
Reference in New Issue
Block a user