- transform.position = new Vector2(Vector2.MoveTowards(transform.position, game.EnemyHoop.transform.position, speed * Time.deltaTime).x, transform.position.y);
- if (Mathf.Abs(transform.position.x - game.EnemyHoop.transform.position.x) < 5f) // Take the shot.
- {
- game.enemy.Shoot(transform);
- }
+ // 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;
+ transform.position = new Vector2(Vector2.MoveTowards(transform.position, game.EnemyHoop.transform.position + new Vector3(targetDistance, 0, 0), speed * Time.deltaTime).x, transform.position.y);