diff --git a/Battle Pong/Ball.gd b/Battle Pong/Ball.gd index f459c43484c607c30ddb6002a40460780e1aa48f..2074169b3225f94a9a2b09747e91a7279e60cdb2 100644 --- a/Battle Pong/Ball.gd +++ b/Battle Pong/Ball.gd @@ -91,4 +91,6 @@ func start(pos): func get_observation(): var move = velocity.normalized()*speed - return {"velocity":{"X":move.x,"Y":move.y}, "position":{"X":position.x,"Y":position.y}} + var ball_player_one = {"velocity":{"X":move.x,"Y":move.y}, "position":{"X":position.x,"Y":position.y}} + var ball_player_two = {"velocity":{"X":move.x*(-1),"Y":move.y}, "position":{"X":abs(position.x - $"/root/GameSettings".display_window_width),"Y":position.y}} + return {'player_one':ball_player_one, 'player_two':ball_player_two}