]> git.cameronkatri.com Git - gmtk-gamejam.git/commitdiff
Tweak AI
authorCarson Katri <carson.katri@gmail.com>
Sat, 12 Jun 2021 22:07:32 +0000 (18:07 -0400)
committerCarson Katri <carson.katri@gmail.com>
Sat, 12 Jun 2021 22:07:32 +0000 (18:07 -0400)
Assets/Scripts/Controllers/AIController.cs
Assets/Scripts/Controllers/GameController.cs

index f897f42ec68ba29a5344055f84352643e2c66a6a..244b5021d273f28cdea30587acf54dbefc699753 100644 (file)
@@ -53,7 +53,7 @@ namespace Controllers
       
       if (!game.enemy.HasBall) // Move towards the ball to grab it.
       {
-        if (Vector2.Distance(player.root.transform.position, transform.position) < 2f) // Repel from the player if they get too close.
+        if (Vector2.Distance(player.root.transform.position, transform.position) < 0.8f) // Repel from the player if they get too close.
         {
           // transform.position += new Vector3(-(player.transform.position - transform.position).normalized.x, 0, 0) * (Time.deltaTime * speed / 2f);
           transform.position = new Vector2(Vector2.MoveTowards(transform.position, player.root.transform.position, -1.5f * speed * Time.deltaTime).x, transform.position.y);
index 15734050f95820d896e0be6a88593e86e73034c6..8dd6fc4482a1ccba888a56b543f66cb170bdbf71 100644 (file)
@@ -85,7 +85,7 @@ namespace Controllers
         if (controller.state == shoot || controller.state == dribble) return false;
         
         // Make sure its within their grab area.
-        if (Vector2.Distance(controller.ball.transform.position, handPosition) > 0.75f) return false;
+        if (Vector2.Distance(controller.ball.transform.position, handPosition) >= 1f) return false;
         
         controller.state = dribble;
         Move(handPosition);