tmp
This commit is contained in:
parent
300edcb889
commit
4e2268835c
@ -34,9 +34,8 @@ class aiPlayer():
|
|||||||
self.player.rot += 90
|
self.player.rot += 90
|
||||||
self.angle += 90
|
self.angle += 90
|
||||||
|
|
||||||
def startAiController(self):
|
def startAiController(self, actions):
|
||||||
actions = ['right', 'straight', 'straight', 'left', 'straight'
|
|
||||||
]
|
|
||||||
for action in actions:
|
for action in actions:
|
||||||
if action == 'straight':
|
if action == 'straight':
|
||||||
self.moveAiPlayer()
|
self.moveAiPlayer()
|
||||||
|
4
main.py
4
main.py
@ -79,8 +79,10 @@ class Game():
|
|||||||
# game loop - set self.playing = False to end the game
|
# game loop - set self.playing = False to end the game
|
||||||
self.playing = True
|
self.playing = True
|
||||||
|
|
||||||
|
actions = ['right', 'straight', 'straight', 'left', 'straight'
|
||||||
|
]
|
||||||
t = aiPlayer.aiPlayer(self.player, game=self)
|
t = aiPlayer.aiPlayer(self.player, game=self)
|
||||||
t.startAiController()
|
t.startAiController(actions=actions)
|
||||||
|
|
||||||
while self.playing:
|
while self.playing:
|
||||||
self.dt = self.clock.tick(FPS) / 1000.0
|
self.dt = self.clock.tick(FPS) / 1000.0
|
||||||
|
Loading…
Reference in New Issue
Block a user