diff --git a/playable/Assets/FailBox.cs b/playable/Assets/FailBox.cs new file mode 100644 index 0000000..dd5898b --- /dev/null +++ b/playable/Assets/FailBox.cs @@ -0,0 +1,15 @@ +using UnityEngine; +using System.Collections; + +public class FailBox : MonoBehaviour { + + // Use this for initialization + void Start () { + + } + + // Update is called once per frame + void Update () { + + } +} diff --git a/playable/Assets/FailBox.cs.meta b/playable/Assets/FailBox.cs.meta new file mode 100644 index 0000000..347518d --- /dev/null +++ b/playable/Assets/FailBox.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: efc7071f62183a94ca17971a2faab6ad +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/playable/Assets/Music/Guajiras.mp3.mp3 b/playable/Assets/Music/Guajiras.mp3.mp3 index 4dbaade..c5baab6 100644 Binary files a/playable/Assets/Music/Guajiras.mp3.mp3 and b/playable/Assets/Music/Guajiras.mp3.mp3 differ diff --git a/playable/Assets/Prefabs/GameStuff.prefab b/playable/Assets/Prefabs/GameStuff.prefab new file mode 100644 index 0000000..704bed0 Binary files /dev/null and b/playable/Assets/Prefabs/GameStuff.prefab differ diff --git a/playable/Assets/Prefabs/GameStuff.prefab.meta b/playable/Assets/Prefabs/GameStuff.prefab.meta new file mode 100644 index 0000000..293122f --- /dev/null +++ b/playable/Assets/Prefabs/GameStuff.prefab.meta @@ -0,0 +1,4 @@ +fileFormatVersion: 2 +guid: 1060187b3c8326e48bd0e3d0661c97a5 +NativeFormatImporter: + userData: diff --git a/playable/Assets/Scenes/Level1.unity b/playable/Assets/Scenes/Level1.unity index 9fb2fd0..24c42ef 100644 Binary files a/playable/Assets/Scenes/Level1.unity and b/playable/Assets/Scenes/Level1.unity differ diff --git a/playable/Assets/Scenes/Level2.unity b/playable/Assets/Scenes/Level2.unity new file mode 100644 index 0000000..e363e85 Binary files /dev/null and b/playable/Assets/Scenes/Level2.unity differ diff --git a/playable/Assets/Scenes/Level2.unity.meta b/playable/Assets/Scenes/Level2.unity.meta new file mode 100644 index 0000000..3f7d76a --- /dev/null +++ b/playable/Assets/Scenes/Level2.unity.meta @@ -0,0 +1,4 @@ +fileFormatVersion: 2 +guid: 9f7e241f4fb0d2a4aaee7d97bb91f549 +DefaultImporter: + userData: diff --git a/playable/Assets/Scripts/playerController.cs b/playable/Assets/Scripts/playerController.cs index f554cb5..f0225c6 100644 --- a/playable/Assets/Scripts/playerController.cs +++ b/playable/Assets/Scripts/playerController.cs @@ -30,6 +30,7 @@ public class playerController : MonoBehaviour { public float dashDistance; public float dashTime; public float dashWait; + public float minY; private float displayedHealth = 3; //currently displayed health @@ -47,7 +48,7 @@ public class playerController : MonoBehaviour { private float lastDash = 0.0f; private bool stopDash = false; public float deathTimer = 3.0f; - + bool droppedCandy = false; @@ -68,8 +69,8 @@ public class playerController : MonoBehaviour { death (); applyPlayerDirection (Input.GetAxisRaw (HorizontalBtn)); damage (); - if (transform.position.y < -3) - health = 0; + //if (transform.position.y < minY) + // health = 0; if (score >= 10) { gameOverDisplay.enabled = true; @@ -167,19 +168,24 @@ public class playerController : MonoBehaviour { if (deathTimer > 0) { deathTimer -=Time.deltaTime; + if (!droppedCandy){ + Instantiate (newCandy, transform.position + Vector3.up, transform.rotation); + droppedCandy = true; + } + transform.position = new Vector3 (0,-50,0); //gameObject.active = false; if(deathTimer <=0) { //gameObject.active = true; - transform.position = new Vector3 (0,30,0); - 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; - + droppedCandy = false; } }//end if @@ -291,6 +297,10 @@ public class playerController : MonoBehaviour { stopDash = true; } + if (col.collider.tag == "failBox") { + health = 0; + + } } void OnTriggerEnter2D(Collider2D trig) diff --git a/playable/ProjectSettings/TagManager.asset b/playable/ProjectSettings/TagManager.asset index af37c69..972dd2a 100644 Binary files a/playable/ProjectSettings/TagManager.asset and b/playable/ProjectSettings/TagManager.asset differ