diff options
Diffstat (limited to 'Assets/Scripts/Controllers/AIController.cs')
-rw-r--r-- | Assets/Scripts/Controllers/AIController.cs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Assets/Scripts/Controllers/AIController.cs b/Assets/Scripts/Controllers/AIController.cs index bd5fee1..9d3d77b 100644 --- a/Assets/Scripts/Controllers/AIController.cs +++ b/Assets/Scripts/Controllers/AIController.cs @@ -53,9 +53,9 @@ namespace Controllers if (!game.enemy.HasBall) return; var hoopDistance = Mathf.Abs(transform.position.x - game.EnemyHoop.transform.position.x); var playerHoopDistance = Mathf.Abs(player.root.transform.position.x - game.EnemyHoop.transform.position.x); - if (hoopDistance < 6f && hoopDistance > 2.5f && (Random.Range(0, 100) > 30 || playerHoopDistance > hoopDistance)) // Take the shot when in range. 70% chance he decides to if the player is standing between him and the basket. + if (hoopDistance < 10.5f && hoopDistance > 2.5f && (Random.Range(0, 100) > 30 || playerHoopDistance > hoopDistance)) // Take the shot when in range. 70% chance he decides to if the player is standing between him and the basket. { - game.enemy.Shoot(transform, 0f); + game.enemy.Shoot(transform, Random.Range(0.5f, 1f)); } } @@ -82,7 +82,7 @@ namespace Controllers { // How far the enemy tries to get from the hoop before shooting. // Currently, it will try to shoot a 3pt. shot if down, but a 2pt. shot if up or tied. - var targetDistance = game.enemy.score < game.player.score ? 5f : 3f; + var targetDistance = game.enemy.score < game.player.score ? 10f : 4f; transform.position = new Vector2(Vector2.MoveTowards(transform.position, game.EnemyHoop.transform.position + new Vector3(targetDistance, 0, 0), speed * Time.deltaTime).x, transform.position.y); } |