From 55c8af1645706b304ea749b8f18c513243a8865b Mon Sep 17 00:00:00 2001
From: Frederic Aust <frederic.aust@hs-bochum.de>
Date: Fri, 5 Feb 2021 21:50:23 +0100
Subject: [PATCH] =?UTF-8?q?Observation=20so=20angepasst,=20dass=20es=20fue?=
 =?UTF-8?q?r=20den=20angemeldeten=20player=5Ftwo=20so=20aussieht,=20als=20?=
 =?UTF-8?q?waere=20dieser=20als=20player=5Fone=20angemeldet.=20(Damit=20Ag?=
 =?UTF-8?q?enten=20als=20player=5Ftwo=20und=20player=5Fone=20spielen=20k?=
 =?UTF-8?q?=C3=B6nnen=20ohne=20angepasst=20zu=20werden)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 Battle Pong/Ball.gd | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/Battle Pong/Ball.gd b/Battle Pong/Ball.gd
index f459c43..2074169 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}
-- 
GitLab