diff options
Diffstat (limited to 'nGJ2019/Assets')
| -rw-r--r-- | nGJ2019/Assets/Scripts/DragonMovement.cs | 30 |
1 files changed, 23 insertions, 7 deletions
diff --git a/nGJ2019/Assets/Scripts/DragonMovement.cs b/nGJ2019/Assets/Scripts/DragonMovement.cs index f0965a2..4c377a5 100644 --- a/nGJ2019/Assets/Scripts/DragonMovement.cs +++ b/nGJ2019/Assets/Scripts/DragonMovement.cs @@ -207,6 +207,9 @@ public class DragonMovement : MonoBehaviour if(hurtCooldown > 0) hurtCooldown -= Time.deltaTime; + if(healthBar.health <= 0) + return; + // keyboard scheme if(Input.GetKey("w")) moveUp(); @@ -265,11 +268,11 @@ public class DragonMovement : MonoBehaviour Gizmos.DrawWireCube(Vector3.zero, new Vector3(2*horizontalBound, 2*verticalBound, 0)); } - private IEnumerator makeGoAway(Transform t) + private IEnumerator makeGoAway(Transform t, float spread) { Vector3 delta = Random.onUnitSphere * Random.Range(0.03f, 0.1f); Vector3 start = t.position; - while((st |