diff --git a/python_example/python_example.py b/python_example/python_example.py index 9ab6d15..1c49ea6 100644 --- a/python_example/python_example.py +++ b/python_example/python_example.py @@ -8,11 +8,9 @@ class PythonExample(BaseAgent): def initialize_agent(self): #This runs once before the bot starts up - pass + self.controller_state = SimpleControllerState() def get_output(self, packet: GameTickPacket) -> SimpleControllerState: - controller_state = SimpleControllerState() - ball_location = Vector2(packet.game_ball.physics.location.x, packet.game_ball.physics.location.y) my_car = packet.game_cars[self.index] @@ -28,10 +26,10 @@ def get_output(self, packet: GameTickPacket) -> SimpleControllerState: else: turn = 1.0 - controller_state.throttle = 1.0 - controller_state.steer = turn + self.controller_state.throttle = 1.0 + self.controller_state.steer = turn - return controller_state + return self.controller_state class Vector2: