aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorCarson Katri <carson.katri@gmail.com>2021-06-12 18:07:32 -0400
committerCarson Katri <carson.katri@gmail.com>2021-06-12 18:07:32 -0400
commita524f24128a4653bbc06eede2379107f9255faf9 (patch)
treec70ae9ee117a3a4c556a87a513c4586df0099faa
parent67c86ed960cc5feaedd06569ad62a340cc0d013f (diff)
downloadgmtk-gamejam-a524f24128a4653bbc06eede2379107f9255faf9.tar.gz
gmtk-gamejam-a524f24128a4653bbc06eede2379107f9255faf9.tar.zst
gmtk-gamejam-a524f24128a4653bbc06eede2379107f9255faf9.zip
Tweak AI
-rw-r--r--Assets/Scripts/Controllers/AIController.cs2
-rw-r--r--Assets/Scripts/Controllers/GameController.cs2
2 files changed, 2 insertions, 2 deletions
diff --git a/Assets/Scripts/Controllers/AIController.cs b/Assets/Scripts/Controllers/AIController.cs
index f897f42..244b502 100644
--- a/Assets/Scripts/Controllers/AIController.cs
+++ b/Assets/Scripts/Controllers/AIController.cs
@@ -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);
diff --git a/Assets/Scripts/Controllers/GameController.cs b/Assets/Scripts/Controllers/GameController.cs
index 1573405..8dd6fc4 100644
--- a/Assets/Scripts/Controllers/GameController.cs
+++ b/Assets/Scripts/Controllers/GameController.cs
@@ -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);