From 4e2268835ca2dfbe6384338f3db8f2745bea5722 Mon Sep 17 00:00:00 2001 From: aliaksei-kudravets Date: Wed, 27 Apr 2022 21:51:09 +0200 Subject: [PATCH] tmp --- game_objects/aiPlayer.py | 5 ++--- main.py | 4 +++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/game_objects/aiPlayer.py b/game_objects/aiPlayer.py index 7eba71b..5f5c588 100644 --- a/game_objects/aiPlayer.py +++ b/game_objects/aiPlayer.py @@ -34,9 +34,8 @@ class aiPlayer(): self.player.rot += 90 self.angle += 90 - def startAiController(self): - actions = ['right', 'straight', 'straight', 'left', 'straight' - ] + def startAiController(self, actions): + for action in actions: if action == 'straight': self.moveAiPlayer() diff --git a/main.py b/main.py index 34aaa87..713b383 100644 --- a/main.py +++ b/main.py @@ -79,8 +79,10 @@ class Game(): # game loop - set self.playing = False to end the game self.playing = True + actions = ['right', 'straight', 'straight', 'left', 'straight' + ] t = aiPlayer.aiPlayer(self.player, game=self) - t.startAiController() + t.startAiController(actions=actions) while self.playing: self.dt = self.clock.tick(FPS) / 1000.0