fix: Ball Not Resetting Position On Reset
This commit is contained in:
		| @@ -71,6 +71,7 @@ public class Game1 : Game | ||||
|         gameManager.Camera = cameraBehaviour; | ||||
|  | ||||
|         //////////////////////////////////////////////////////////////////////////////////// | ||||
|  | ||||
|         IGameObject gameObjectPongManager = gameManager.InstantiateGameObject<GameObject>(); | ||||
|         gameObjectPongManager.Name = "Pong Game Manager"; | ||||
|         pongScoreboard = gameObjectPongManager.BehaviourController.AddBehaviour<PongScoreboard>(5); | ||||
| @@ -180,6 +181,7 @@ public class Game1 : Game | ||||
|         pongScoreboard.OnReset += () => | ||||
|         { | ||||
|             gameObjectBall.StateEnable.Enabled = true; | ||||
|             rigidBodyBall.BehaviourController.GameObject.Transform.Position = Vector2D.Zero; | ||||
|             rigidBodyBall.Velocity = Vector2D.One * movementBallBehaviour.Speed; | ||||
|             textBehaviourLeft.Text = pongScoreboard.ScoreLeft.ToString(); | ||||
|             textBehaviourRight.Text = pongScoreboard.ScoreRight.ToString(); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user