diff --git a/playable/Assets/Lachlan_jump_work.unity b/playable/Assets/Lachlan_jump_work.unity index e2695a0..8499b2e 100644 Binary files a/playable/Assets/Lachlan_jump_work.unity and b/playable/Assets/Lachlan_jump_work.unity differ diff --git a/playable/Assets/Scripts/Menu.cs b/playable/Assets/Scripts/Menu.cs index 07e216a..e779fa7 100644 --- a/playable/Assets/Scripts/Menu.cs +++ b/playable/Assets/Scripts/Menu.cs @@ -11,13 +11,17 @@ public class Menu : MonoBehaviour { public GameObject musicEpic; + private bool start = false; private bool menu = true; private float goreCount = 20; private string music = "Traditional"; + + + // Use this for initialization void Start () { - + } // Update is called once per frame @@ -38,10 +42,18 @@ public class Menu : MonoBehaviour { Time.timeScale = 0; else Time.timeScale = 1; + + if (Input.GetKey(KeyCode.F12)) + AudioListener.volume = 0.0f; + if (Input.GetKey(KeyCode.F11)) + AudioListener.volume = 1.0f; + + } void OnGUI () { + if (start) { // Make a background box GUI.Box (new Rect (Screen.width / 2 - 100, Screen.height / 2 - 150, 200, 300), "Menu"); @@ -105,13 +117,8 @@ public class Menu : MonoBehaviour { musicEpic.SetActive(false); musicTrad.SetActive(true); } - else if (music =="Traditional"){ - music = "Epic"; - musicEpic.SetActive(true); - musicTrad.SetActive(false); - } - } + GUI.Label(new Rect(Screen.width/2 +5, Screen.height/2 +55, 90, 30), "" +music); if (GUI.Button (new Rect (Screen.width / 2-90 , Screen.height / 2 +90, 180, 30), "Exit Menu")) { diff --git a/playable/Assets/Scripts/playerController.cs b/playable/Assets/Scripts/playerController.cs index 8d96ab7..355fb6f 100644 --- a/playable/Assets/Scripts/playerController.cs +++ b/playable/Assets/Scripts/playerController.cs @@ -43,13 +43,18 @@ public class playerController : MonoBehaviour { private bool canDash = true; private float lastDash; private bool stopDash = false; + public float deathTimer = 3.0f; + + + + + void Start(){ if (transform.rotation.y == 180) curDirection = -1; else curDirection = 1; - } @@ -70,6 +75,8 @@ public class playerController : MonoBehaviour { } + + } void FixedUpdate() { @@ -148,15 +155,28 @@ public class playerController : MonoBehaviour { }//end displayHealth //respawns player if they die - private void death(){ - if (health <= 0) { - Instantiate (newCandy, transform.position + Vector3.up, transform.rotation); + private void death() + { + if (health <= 0) + if (deathTimer > 0) + { + deathTimer -=Time.deltaTime; + //gameObject.active = false; + + if(deathTimer <=0) + { + //gameObject.active = true; - Vector3 spawnPos = new Vector3 (Random.Range (-20.0f, 20.0f), 15.0f, 0); //picks random position - health = 3; //resets life - transform.position = spawnPos; //changes position - rigidbody2D.velocity = Vector2.zero; + Instantiate (newCandy, transform.position + Vector3.up, transform.rotation); + Vector3 spawnPos = new Vector3 (Random.Range (-20.0f, 20.0f), 15.0f, 0); //picks random position + health = 3; //resets life + transform.position = spawnPos; //changes position + rigidbody2D.velocity = Vector2.zero; + deathTimer = deathTimer + 3.02f; + + + } }//end if }//end death @@ -181,6 +201,7 @@ public class playerController : MonoBehaviour { } + //spin IEnumerator spinAttack(Vector3 byAngles, float inTime) { isSpinning = true; canSpin = false; @@ -200,7 +221,7 @@ public class playerController : MonoBehaviour { isSpinning = false; stick.isAttacking = false; } - + //dash IEnumerator dashAttack (float dashDistance,float dashTime) { float endPosition; int dashDirection; diff --git a/playable/Assets/Scripts/stickController.cs b/playable/Assets/Scripts/stickController.cs index 9bcbabc..e8a1231 100644 --- a/playable/Assets/Scripts/stickController.cs +++ b/playable/Assets/Scripts/stickController.cs @@ -8,6 +8,7 @@ public class stickController : MonoBehaviour { public bool isAttacking; public bool isSpinning; + // Use this for initialization void Start () { @@ -51,4 +52,6 @@ public class stickController : MonoBehaviour { } + + }