Skip to content

Commit

Permalink
Enemies make warning sound when close to goal
Browse files Browse the repository at this point in the history
  • Loading branch information
ddabble committed Feb 22, 2018
1 parent d843e03 commit a09717e
Show file tree
Hide file tree
Showing 6 changed files with 197 additions and 168 deletions.
2 changes: 1 addition & 1 deletion Assets/MagicBook/Scripts/Spells/Fireball/Fireball.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ protected override void FixedUpdate_Derived()
transform.Translate(direction * (speed * Time.deltaTime), Space.World);

if (!passedHead
&& (transform.position - Player.instance.headCollider.transform.position).magnitude >= towerDiameter)
&& Vector3.Distance(transform.position, Player.instance.headCollider.transform.position) >= towerDiameter)
{
GetComponent<SphereCollider>().radius = originalSphereColliderRadius;
passedHead = true;
Expand Down
2 changes: 1 addition & 1 deletion Assets/Prefabs/Decorations/Butterfly_randomFlapping.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ public override void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo
float speedMultiplier_percentage = Random.value * (speedVariabilityPercentage * 2) - speedVariabilityPercentage;
// Translates to between 0.95 and 1.05
float speedMultiplier = 1f + speedMultiplier_percentage / 100f;
animator.SetFloat("SpeedMultiplier", speedMultiplier);
animator.SetFloat(speedMultiplierHash, speedMultiplier);
}
}
Loading

0 comments on commit a09717e

Please sign in to comment.