Smoothed out a few things

This commit is contained in:
2018-04-23 10:12:50 +10:00
parent 47713e6012
commit cdfb834285
16 changed files with 465 additions and 88 deletions
+9 -10
View File
@@ -21,15 +21,14 @@ public class Player : MonoBehaviour {
public GameObject icePelletPrefab;
public GameObject windPelletPrefab;
AudioSource aSource;
public AudioClip fireClip, iceClip, windClip, switchClip;
AudioSource aSource;
public AudioClip fireClip, iceClip, windClip, switchClip;
void Awake() {
animator = GetComponent<Animator> ();
rigidBody = GetComponent<Rigidbody2D> ();
witchAnimateScript = GetComponent<witchAnimate> ();
aSource = GetComponent<AudioSource>();
aSource = GetComponent<AudioSource>();
speed = 0.79f;
}
@@ -55,7 +54,7 @@ public class Player : MonoBehaviour {
lastDirection = rigidBody.velocity;
}
if (Input.GetButtonDown("Switch")) aSource.PlayOneShot(switchClip);
if (Input.GetButtonDown("Switch")) aSource.PlayOneShot(switchClip);
}
void Move() {
@@ -72,16 +71,16 @@ public class Player : MonoBehaviour {
switch (witchAnimateScript.el) {
case witchAnimate.Element.fire:
aSource.PlayOneShot(fireClip);
aSource.PlayOneShot(fireClip);
pellet = Instantiate (firePelletPrefab);
break;
case witchAnimate.Element.ice:
aSource.PlayOneShot(iceClip);
pellet = Instantiate (icePelletPrefab);
aSource.PlayOneShot(iceClip);
pellet = Instantiate (icePelletPrefab);
break;
case witchAnimate.Element.wind:
aSource.PlayOneShot(windClip);
pellet = Instantiate (windPelletPrefab);
aSource.PlayOneShot(windClip);
pellet = Instantiate (windPelletPrefab);
break;
}