aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikkel Bybjerg <mikkel.bybjerg@hotmail.com>2019-04-27 04:24:12 +0200
committerMikkel Bybjerg <mikkel.bybjerg@hotmail.com>2019-04-27 04:24:12 +0200
commitb8c4567189d2d4f49d0331858519ac6455e1eb3d (patch)
tree243498d5d7757d82d055e50d7be382267d09a45e /nGJ2019/Assets/Scripts/DragonMovement.cs
parent2c708ae0d09ca2de25ce60617875f89bfdbbd7e8 (diff)
better dragon particle effects
Diffstat (limited to 'nGJ2019/Assets/Scripts/DragonMovement.cs')
-rw-r--r--nGJ2019/Assets/Scripts/DragonMovement.cs49
1 files changed, 30 insertions, 19 deletions
diff --git a/nGJ2019/Assets/Scripts/DragonMovement.cs b/nGJ2019/Assets/Scripts/DragonMovement.cs
index 67f5cde..64d7f21 100644
--- a/nGJ2019/Assets/Scripts/DragonMovement.cs
+++ b/nGJ2019/Assets/Scripts/DragonMovement.cs
@@ -89,7 +89,7 @@ public class DragonMovement : MonoBehaviour
{
while(state == State.normal && swarm.Noise > 0)
{
- swarm.Noise -= 0.08f;
+ swarm.Noise -= 0.12f;
yield return new WaitForSeconds(0.01f);
}
if(state == State.normal)
@@ -125,21 +125,32 @@ public class DragonMovement : MonoBehaviour
StartCoroutine("transformSpread");
}
- private void turnNormal()
+ private void turnAntiSwirl()
{
- State prev = state;
- state = State.normal;
- if(prev == State.swirl)
+ if(state == State.swirl)
{
+ state = State.normal;
turnVisible(true);
swarm.activate(false);
}
-
- if(prev == State.slim)
+ }
+
+ private void turnAntiSlim()
+ {
+ if(state == State.slim)
+ {
+ state = State.normal;
StartCoroutine("transformAntiSlim");
-
- if(prev == State.spread)
+ }
+ }
+
+ private void turnAntiSpread()
+ {
+ if(state == State.spread)
+ {
+ state = State.normal;
StartCoroutine("transformAntiSpread");
+ }
}
private void resetTurn()
@@ -151,7 +162,7 @@ public class DragonMovement : MonoBehaviour
void Start()
{
swarm = GetComponent<SwarmSystem>();
- swarm.activate(true);
+ swarm.activate(false);
}
void Update()
@@ -165,20 +176,20 @@ public class DragonMovement : MonoBehaviour
if(Input.GetKey("d"))
moveRight();
- if(Input.GetKeyDown("r"))
+ if(Input.GetKeyDown("i"))
turnSwirl();
- if(Input.GetKeyUp("r"))
- turnNormal();
+ if(Input.GetKeyUp("i"))
+ turnAntiSwirl();
- if(Input.GetKeyDown("f"))
+ if(Input.GetKeyDown("j"))
turnSlim();
- if(Input.GetKeyUp("f"))
- turnNormal();
+ if(Input.GetKeyUp("j"))
+ turnAntiSlim();
- if(Input.GetKeyDown("e"))
+ if(Input.GetKeyDown("k"))
turnSpread();
- if(Input.GetKeyUp("e"))
- turnNormal();
+ if(Input.GetKeyUp("k"))
+ turnAntiSpread();
}
void OnDrawGizmosSelected()