diff options
author | Mikkel Bybjerg <mikkel.bybjerg@hotmail.com> | 2019-04-28 05:21:31 +0200 |
---|---|---|
committer | Mikkel Bybjerg <mikkel.bybjerg@hotmail.com> | 2019-04-28 05:21:31 +0200 |
commit | 35d8cdbd3c6d77ceaf73ac00d4a2876dcda6645f (patch) | |
tree | f3949dd5fe02092d11f3296fc32b47dcea5140d2 /nGJ2019/Assets/Scripts | |
parent | f28fd7ed5916af2a5a590e36635859d2a4a7cc3c (diff) |
wiggle wiggle
Diffstat (limited to 'nGJ2019/Assets/Scripts')
-rw-r--r-- | nGJ2019/Assets/Scripts/DragonMovement.cs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/nGJ2019/Assets/Scripts/DragonMovement.cs b/nGJ2019/Assets/Scripts/DragonMovement.cs index 302a9e7..f0965a2 100644 --- a/nGJ2019/Assets/Scripts/DragonMovement.cs +++ b/nGJ2019/Assets/Scripts/DragonMovement.cs @@ -17,6 +17,8 @@ public class DragonMovement : MonoBehaviour public float horizontalBound = 6f; public float verticalBound = 4f; + private float slitherPhase = 0; + public HealthBar healthBar; private float hurtCooldown = 0; @@ -188,6 +190,16 @@ public class DragonMovement : MonoBehaviour if(transform.position.x > horizontalBound) transform.position = new Vector3(horizontalBound, transform.position.y, transform.position.z); + + slitherPhase += 0.1f; + foreach(Transform t in swarm.meshRender.bones) + { + t.Translate(new Vector3(0, Mathf.Sin(t.position.x-transform.position.x+slitherPhase)*0.002f, 0), Space.World); + } + foreach(Renderer r in solids) + { + r.transform.Translate(new Vector3(0, Mathf.Sin(r.transform.position.x-transform.position.x+slitherPhase+0.2f)*-0.008f, 0), Space.World); + } } void Update() |