Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions python_example/python_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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:
Expand Down