generated from mwc/project_game
@chris need helo wuth health
This commit is contained in:
22
obstacle.py
Normal file
22
obstacle.py
Normal file
@@ -0,0 +1,22 @@
|
||||
import retro
|
||||
(update)
|
||||
|
||||
class Scene:
|
||||
character A:'===='
|
||||
character B:'M'
|
||||
|
||||
def __init__(self, position):
|
||||
self.position -= position
|
||||
|
||||
def play_turn(self, game):
|
||||
if game.turn_number % 2 == 0:
|
||||
x, y = self.position
|
||||
if y == HEIGHT - 1:
|
||||
game.remove_agent_by_name(self.name)
|
||||
else:
|
||||
runner = game.get_agent_by_name('ship')
|
||||
new_position = (x, y + 1)
|
||||
if new_position == runner.position:
|
||||
game.end()
|
||||
else:
|
||||
self.position = new_position
|
||||
Reference in New Issue
Block a user