diff --git a/playable/Assets/Music/7z938.exe.meta b/playable/Assets/Music/7z938.exe.meta deleted file mode 100644 index 849f390..0000000 --- a/playable/Assets/Music/7z938.exe.meta +++ /dev/null @@ -1,4 +0,0 @@ -fileFormatVersion: 2 -guid: 713681be356b35042b5eca7d16c896a6 -DefaultImporter: - userData: diff --git a/playable/Assets/Music/Piñata Sounds.rar b/playable/Assets/Music/Piñata Sounds.rar deleted file mode 100644 index e5bbdd0..0000000 Binary files a/playable/Assets/Music/Piñata Sounds.rar and /dev/null differ diff --git a/playable/Assets/Music/Piñata Sounds.rar.meta b/playable/Assets/Music/Piñata Sounds.rar.meta deleted file mode 100644 index a7591a9..0000000 --- a/playable/Assets/Music/Piñata Sounds.rar.meta +++ /dev/null @@ -1,4 +0,0 @@ -fileFormatVersion: 2 -guid: 382f6c8c22ea2804d9e143e6985d85bb -DefaultImporter: - userData: diff --git a/playable/Assets/Prefabs/GameStuff.prefab b/playable/Assets/Prefabs/GameStuff.prefab index c8a969c..e047e03 100644 Binary files a/playable/Assets/Prefabs/GameStuff.prefab and b/playable/Assets/Prefabs/GameStuff.prefab differ diff --git a/playable/Assets/Prefabs/PinatatFrac 1.prefab b/playable/Assets/Prefabs/PinatatFrac 1.prefab new file mode 100644 index 0000000..4213f70 Binary files /dev/null and b/playable/Assets/Prefabs/PinatatFrac 1.prefab differ diff --git a/playable/Assets/Prefabs/PinatatFrac 1.prefab.meta b/playable/Assets/Prefabs/PinatatFrac 1.prefab.meta new file mode 100644 index 0000000..820bb6c --- /dev/null +++ b/playable/Assets/Prefabs/PinatatFrac 1.prefab.meta @@ -0,0 +1,4 @@ +fileFormatVersion: 2 +guid: 527a72be3702f2345a606bbe21ff075a +NativeFormatImporter: + userData: diff --git a/playable/Assets/Prefabs/Players.prefab b/playable/Assets/Prefabs/Players.prefab new file mode 100644 index 0000000..e8eca4c Binary files /dev/null and b/playable/Assets/Prefabs/Players.prefab differ diff --git a/playable/Assets/Prefabs/Players.prefab.meta b/playable/Assets/Prefabs/Players.prefab.meta new file mode 100644 index 0000000..c808135 --- /dev/null +++ b/playable/Assets/Prefabs/Players.prefab.meta @@ -0,0 +1,4 @@ +fileFormatVersion: 2 +guid: a5254e11385551e45a99cb184f6309c0 +NativeFormatImporter: + userData: diff --git a/playable/Assets/Prefabs/candy.prefab b/playable/Assets/Prefabs/candy.prefab index 6dda2c9..055c946 100644 Binary files a/playable/Assets/Prefabs/candy.prefab and b/playable/Assets/Prefabs/candy.prefab differ diff --git a/playable/Assets/Scenes/Level1.unity b/playable/Assets/Scenes/Level1.unity index d8fc6db..c06c3c3 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 index f85cc3b..9308487 100644 Binary files a/playable/Assets/Scenes/Level2.unity and b/playable/Assets/Scenes/Level2.unity differ diff --git a/playable/Assets/Scripts/PlayerExplosion.cs b/playable/Assets/Scripts/PlayerExplosion.cs new file mode 100644 index 0000000..4456cf6 --- /dev/null +++ b/playable/Assets/Scripts/PlayerExplosion.cs @@ -0,0 +1,45 @@ +using UnityEngine; +using System.Collections; + +public class PlayerExplosion : MonoBehaviour { + + public float explosionDistance; + public float explosionTime; + + public int fraqAmount = 0; + + // Use this for initialization + void Start () { + + foreach (Transform child in transform) + { + fraqAmount++; + StartCoroutine (explosion (child)); + } + + } + + // Update is called once per frame + void Update () { + + } + + IEnumerator explosion(Transform debris){ + Vector3 centre = transform.position; + Vector3 scaleDirection = debris.position - centre; + Debug.Log ("Scale Direction" + scaleDirection); + + for (float i = 0; i < 1; i += Time.deltaTime/explosionTime) { + debris.position =centre +( scaleDirection * Mathf.Lerp (1, explosionDistance, i)); + + yield return null; + } + + fraqAmount--; + + if (fraqAmount == 0) { + Destroy(gameObject,0.0f); + } + + } +} diff --git a/playable/Assets/Scripts/PlayerExplosion.cs.meta b/playable/Assets/Scripts/PlayerExplosion.cs.meta new file mode 100644 index 0000000..015a2c0 --- /dev/null +++ b/playable/Assets/Scripts/PlayerExplosion.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 0f4be3bad839bf744aef5ca4e467a8f3 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/playable/Assets/Scripts/collectable.cs b/playable/Assets/Scripts/collectable.cs index 443f49b..832a049 100644 --- a/playable/Assets/Scripts/collectable.cs +++ b/playable/Assets/Scripts/collectable.cs @@ -2,9 +2,13 @@ using System.Collections; public class collectable : MonoBehaviour { + + public float waitTime; + float startTime; // Use this for initialization void Start () { + startTime = Time.time; float rand = Random.Range (0, 7); int randColour = Mathf.FloorToInt (rand); @@ -39,5 +43,8 @@ public class collectable : MonoBehaviour { // Update is called once per frame void Update () { transform.Rotate (new Vector3 (15, 30, 45) * Time.deltaTime); + if (waitTime < Time.time - startTime) { + gameObject.GetComponent().enabled = true; + } } } diff --git a/playable/Assets/Scripts/playerController.cs b/playable/Assets/Scripts/playerController.cs index d643c2d..a0b7e46 100644 --- a/playable/Assets/Scripts/playerController.cs +++ b/playable/Assets/Scripts/playerController.cs @@ -18,6 +18,7 @@ public class playerController : MonoBehaviour { public GUIText scoreDisplay; public GUIText gameOverDisplay; public GameObject dashDisplay; + public GameObject playerFrac; public float runSpeed; //run speed public float jumpHeight; //jump height @@ -30,7 +31,11 @@ public class playerController : MonoBehaviour { public float dashDistance; public float dashTime; public float dashWait; - public float minY; + public float minY;public bool heartBlack = false; + public bool heartColor = true; + public bool dead = false; + public float heartTimer = 0.0f; + private float displayedHealth = 3; //currently displayed health @@ -49,10 +54,8 @@ public class playerController : MonoBehaviour { private bool stopDash = false; public float deathTimer = 3.0f; bool droppedCandy = false; - public bool heartBlack = false; - public bool heartColor = true; - public bool dead = false; - public float heartTimer = 0.0f; + private bool exploded = false; + @@ -185,14 +188,24 @@ public class playerController : MonoBehaviour { if (heartTimer >=2.5f){ health = 2; } + if (!exploded){ + + exploded = true; + Vector3 fracRotation = transform.rotation.eulerAngles; + fracRotation.y +=90; + GameObject explosion = Instantiate (playerFrac, transform.position+(Vector3.up*-3), Quaternion.Euler(fracRotation)) as GameObject; + } + } if (deathTimer > 0) { deathTimer -= Time.deltaTime; if (!droppedCandy) { Instantiate (newCandy, transform.position + Vector3.up, transform.rotation); + Debug.Log ("Exploded position: " + transform.position); + droppedCandy = true; } - transform.position = new Vector3 (0, -50, 0); + transform.position = new Vector3 (10, -50, 0); if (deathTimer <= 0) { Vector3 spawnPos = new Vector3 (Random.Range (-20.0f, 20.0f), 15.0f, 0); //picks random position health = 3; //resets life @@ -205,6 +218,7 @@ public class playerController : MonoBehaviour { heartBlack = false; dead = false; heartColor = true; + exploded = false; } }//end if @@ -333,7 +347,7 @@ public class playerController : MonoBehaviour { Debug.Log (trig.gameObject.tag); if (trig.gameObject.tag == "candy") { - trig.gameObject.SetActive (false); + Destroy (trig.gameObject, 0.0f); score++; scoreDisplay.text = "score: " + score.ToString (); } diff --git a/playable/ProjectSettings/TimeManager.asset b/playable/ProjectSettings/TimeManager.asset index 6a2964f..7632e16 100644 Binary files a/playable/ProjectSettings/TimeManager.asset and b/playable/ProjectSettings/TimeManager.asset differ