diff --git a/playable/Assets/Horn2.fbx b/playable/Assets/Horn2.fbx new file mode 100644 index 0000000..2cfc45f Binary files /dev/null and b/playable/Assets/Horn2.fbx differ diff --git a/playable/Assets/Horn2.fbx.meta b/playable/Assets/Horn2.fbx.meta new file mode 100644 index 0000000..db0fb43 --- /dev/null +++ b/playable/Assets/Horn2.fbx.meta @@ -0,0 +1,127 @@ +fileFormatVersion: 2 +guid: 23756e737f935a140810973e4e080871 +ModelImporter: + serializedVersion: 16 + fileIDToRecycleName: + 100000: //RootNode + 100002: pCube1 + 100004: pTorus1 + 100006: pTorus10 + 100008: pTorus11 + 100010: pTorus12 + 100012: pTorus13 + 100014: pTorus2 + 100016: pTorus3 + 100018: pTorus4 + 100020: pTorus5 + 100022: pTorus6 + 100024: pTorus8 + 100026: pTorus9 + 400000: //RootNode + 400002: pCube1 + 400004: pTorus1 + 400006: pTorus10 + 400008: pTorus11 + 400010: pTorus12 + 400012: pTorus13 + 400014: pTorus2 + 400016: pTorus3 + 400018: pTorus4 + 400020: pTorus5 + 400022: pTorus6 + 400024: pTorus8 + 400026: pTorus9 + 2300000: pCube1 + 2300002: pTorus1 + 2300004: pTorus10 + 2300006: pTorus11 + 2300008: pTorus12 + 2300010: pTorus13 + 2300012: pTorus2 + 2300014: pTorus3 + 2300016: pTorus4 + 2300018: pTorus5 + 2300020: pTorus6 + 2300022: pTorus8 + 2300024: pTorus9 + 3300000: pCube1 + 3300002: pTorus1 + 3300004: pTorus10 + 3300006: pTorus11 + 3300008: pTorus12 + 3300010: pTorus13 + 3300012: pTorus2 + 3300014: pTorus3 + 3300016: pTorus4 + 3300018: pTorus5 + 3300020: pTorus6 + 3300022: pTorus8 + 3300024: pTorus9 + 4300000: pCube1 + 4300002: pTorus1 + 4300004: pTorus2 + 4300006: pTorus3 + 4300008: pTorus4 + 4300010: pTorus5 + 4300012: pTorus6 + 4300014: pTorus8 + 4300016: pTorus9 + 4300018: pTorus10 + 4300020: pTorus11 + 4300022: pTorus12 + 4300024: pTorus13 + 9500000: //RootNode + materials: + importMaterials: 1 + materialName: 0 + materialSearch: 1 + animations: + legacyGenerateAnimations: 4 + bakeSimulation: 0 + optimizeGameObjects: 0 + motionNodeName: + animationCompression: 1 + animationRotationError: .5 + animationPositionError: .5 + animationScaleError: .5 + animationWrapMode: 0 + extraExposedTransformPaths: [] + clipAnimations: [] + isReadable: 1 + meshes: + lODScreenPercentages: [] + globalScale: .00999999978 + meshCompression: 0 + addColliders: 0 + importBlendShapes: 1 + swapUVChannels: 0 + generateSecondaryUV: 0 + useFileUnits: 1 + optimizeMeshForGPU: 1 + weldVertices: 1 + secondaryUVAngleDistortion: 8 + secondaryUVAreaDistortion: 15.000001 + secondaryUVHardAngle: 88 + secondaryUVPackMargin: 4 + tangentSpace: + normalSmoothAngle: 60 + splitTangentsAcrossUV: 1 + normalImportMode: 0 + tangentImportMode: 1 + importAnimation: 1 + copyAvatar: 0 + humanDescription: + human: [] + skeleton: [] + armTwist: .5 + foreArmTwist: .5 + upperLegTwist: .5 + legTwist: .5 + armStretch: .0500000007 + legStretch: .0500000007 + feetSpacing: 0 + rootMotionBoneName: + lastHumanDescriptionAvatarSource: {instanceID: 0} + animationType: 2 + additionalBone: 0 + userData: diff --git a/playable/Assets/Lachlan_jump_work.unity b/playable/Assets/Lachlan_jump_work.unity index 283b1a7..d96cc01 100644 Binary files a/playable/Assets/Lachlan_jump_work.unity and b/playable/Assets/Lachlan_jump_work.unity differ diff --git a/playable/Assets/Pinata.controller b/playable/Assets/Pinata.controller index 71ca7b0..9220a2c 100644 Binary files a/playable/Assets/Pinata.controller and b/playable/Assets/Pinata.controller differ diff --git a/playable/Assets/Prefabs.meta b/playable/Assets/Prefabs.meta new file mode 100644 index 0000000..c67bd1e --- /dev/null +++ b/playable/Assets/Prefabs.meta @@ -0,0 +1,5 @@ +fileFormatVersion: 2 +guid: fb9b0f999f81a7a47b113adc8c0d8d8e +folderAsset: yes +DefaultImporter: + userData: diff --git a/playable/Assets/Confetti.prefab b/playable/Assets/Prefabs/Confetti.prefab similarity index 99% rename from playable/Assets/Confetti.prefab rename to playable/Assets/Prefabs/Confetti.prefab index fc52f94..c6c8d21 100644 Binary files a/playable/Assets/Confetti.prefab and b/playable/Assets/Prefabs/Confetti.prefab differ diff --git a/playable/Assets/Confetti.prefab.meta b/playable/Assets/Prefabs/Confetti.prefab.meta similarity index 100% rename from playable/Assets/Confetti.prefab.meta rename to playable/Assets/Prefabs/Confetti.prefab.meta diff --git a/playable/Assets/Heart 1.prefab b/playable/Assets/Prefabs/Heart 1.prefab similarity index 100% rename from playable/Assets/Heart 1.prefab rename to playable/Assets/Prefabs/Heart 1.prefab diff --git a/playable/Assets/Heart 1.prefab.meta b/playable/Assets/Prefabs/Heart 1.prefab.meta similarity index 100% rename from playable/Assets/Heart 1.prefab.meta rename to playable/Assets/Prefabs/Heart 1.prefab.meta diff --git a/playable/Assets/Heart.prefab b/playable/Assets/Prefabs/Heart.prefab similarity index 100% rename from playable/Assets/Heart.prefab rename to playable/Assets/Prefabs/Heart.prefab diff --git a/playable/Assets/Heart.prefab.meta b/playable/Assets/Prefabs/Heart.prefab.meta similarity index 100% rename from playable/Assets/Heart.prefab.meta rename to playable/Assets/Prefabs/Heart.prefab.meta diff --git a/playable/Assets/Prefabs/candy.prefab b/playable/Assets/Prefabs/candy.prefab new file mode 100644 index 0000000..e5cf366 Binary files /dev/null and b/playable/Assets/Prefabs/candy.prefab differ diff --git a/playable/Assets/Prefabs/candy.prefab.meta b/playable/Assets/Prefabs/candy.prefab.meta new file mode 100644 index 0000000..d24700b --- /dev/null +++ b/playable/Assets/Prefabs/candy.prefab.meta @@ -0,0 +1,4 @@ +fileFormatVersion: 2 +guid: 6b96e1a2024a3434ca84415e0bdba2bc +NativeFormatImporter: + userData: diff --git a/playable/Assets/Scripts/P2_weapon.cs b/playable/Assets/Scripts/P2_weapon.cs deleted file mode 100644 index df1aa8e..0000000 --- a/playable/Assets/Scripts/P2_weapon.cs +++ /dev/null @@ -1,21 +0,0 @@ -using UnityEngine; -using System.Collections; - -public class P2_weapon : MonoBehaviour { - - // Use this for initialization - void Start () { - - } - - void Update (){ - if (Input.GetKeyDown("space")) - transform.Translate (Vector3.right); - else if (Input.GetKeyUp("space")) - transform.Translate (Vector3.left); - - } - - // Update is called once per frame - -} \ No newline at end of file diff --git a/playable/Assets/Scripts/P2_weapon.cs.meta b/playable/Assets/Scripts/P2_weapon.cs.meta deleted file mode 100644 index dc87fb3..0000000 --- a/playable/Assets/Scripts/P2_weapon.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: f348d28f3452e574c9fe07574e3ca5ee -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/playable/Assets/Scripts/PlayerControler.cs b/playable/Assets/Scripts/PlayerControler.cs deleted file mode 100644 index 63d996f..0000000 --- a/playable/Assets/Scripts/PlayerControler.cs +++ /dev/null @@ -1,115 +0,0 @@ -using UnityEngine; -using System.Collections; - -public class PlayerControler : MonoBehaviour { - - - public Animator animator; - // Use this for initialization - void Start () { - } - - public float speed; - public Vector2 jumpVector; - public int health = 0; - private int displayedHealth = 0; - private bool updateHealth = false; - private float curDirection = -1; - public GameObject bullet; - public GameObject heart; - bool canJump = true; - public GameObject newConfetti; - - - - void Update() { - Vector2 velo = rigidbody2D.velocity; - velo.x = Input.GetAxis ("Horizontal_P1") * speed; - rigidbody2D.velocity = velo; - animator.SetFloat("Velocity",velo.magnitude); - animator.SetBool ("Fall", !canJump); - if (curDirection != Input.GetAxisRaw ("Horizontal_P1")) - applyPlayerDirection (Input.GetAxisRaw ("Horizontal_P1")); - - if (displayedHealth != health) { - updateHealth = true; - } - if (updateHealth) - displayHealth (health); - - if (health == 0) - death(); - - - if (Input.GetKey (KeyCode.UpArrow)){ - if (canJump == true){ - rigidbody2D.velocity = jumpVector; - canJump = false; - } - } - - //if (Input.GetKey (KeyCode.Space)){ - //shoot - //GameObject bulletGO = Instantiate (bullet) as GameObject; - //bulletGO.transform.position = transform.position; - //} - } - - private void displayHealth(int health){ - GameObject[] hearts = GameObject.FindGameObjectsWithTag("heartUI2"); - foreach (GameObject desHeart in hearts) - GameObject.Destroy (desHeart); - - for (int i=1; i<= health; i++) { - GameObject heartCanister = Instantiate (heart) as GameObject; - Vector3 heartPos = new Vector3 (1-(i * 0.033f), 0.95f, 0); - heartCanister.transform.position = heartPos; - } - displayedHealth = health; - updateHealth = false; - } - - private void applyPlayerDirection(float moveHorizontal) - { - if (moveHorizontal != 0) - { - transform.Rotate(0,180,0); - curDirection = moveHorizontal; - } - } - - private void Confettishoot(Vector3 target,float size){ - Debug.Log ("Creating Confetti"); - - target.y += 1.5f; - for (int i = 0; i col.transform.position.y){ - col.gameObject.GetComponent().health --; - Confettishoot(col.gameObject.transform.position,20.0f); - //health --; - rigidbody2D.velocity = jumpVector; - canJump = false; - } - - } - } - -} diff --git a/playable/Assets/Scripts/collectable.cs b/playable/Assets/Scripts/collectable.cs new file mode 100644 index 0000000..443f49b --- /dev/null +++ b/playable/Assets/Scripts/collectable.cs @@ -0,0 +1,43 @@ +using UnityEngine; +using System.Collections; + +public class collectable : MonoBehaviour { + + // Use this for initialization + void Start () { + float rand = Random.Range (0, 7); + int randColour = Mathf.FloorToInt (rand); + + switch (randColour) { + case 0: + renderer.material.color = Color.cyan; + break; + case 1: + renderer.material.color = Color.red; + break; + case 2: + renderer.material.color = Color.blue; + break; + case 3: + renderer.material.color = Color.green; + break; + case 4: + renderer.material.color = Color.yellow; + break; + case 5: + renderer.material.color = Color.magenta; + break; + default: + renderer.material.color = Color.black; + break; + } + + + + } + + // Update is called once per frame + void Update () { + transform.Rotate (new Vector3 (15, 30, 45) * Time.deltaTime); + } +} diff --git a/playable/Assets/Scripts/PlayerControler.cs.meta b/playable/Assets/Scripts/collectable.cs.meta similarity index 78% rename from playable/Assets/Scripts/PlayerControler.cs.meta rename to playable/Assets/Scripts/collectable.cs.meta index 8794a99..e752bcc 100644 --- a/playable/Assets/Scripts/PlayerControler.cs.meta +++ b/playable/Assets/Scripts/collectable.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 2f110149822ba46b39723c6d01336581 +guid: de1432d88ba03a641ab648872aee7e07 MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/playable/Assets/Scripts/player2_controls.cs b/playable/Assets/Scripts/player2_controls.cs deleted file mode 100644 index c93713b..0000000 --- a/playable/Assets/Scripts/player2_controls.cs +++ /dev/null @@ -1,116 +0,0 @@ -using UnityEngine; -using System.Collections; - -public class player2_controls : MonoBehaviour { - - public Animator animator; - - void Start () { - - } - - public float speed; - public Vector2 jumpVector; - public int health = 0; - private int displayedHealth = 0; - private bool updateHealth = false; - private float curDirection = 1; - public GameObject bullet; - public GameObject heart; - bool canJump = true; - - public string HorizontalBtn; - - public GameObject newConfetti; - //Horizontal_P2 - - - - void Update() { - Vector2 velo = rigidbody2D.velocity; - velo.x = Input.GetAxis (HorizontalBtn) * speed; - rigidbody2D.velocity = velo; - animator.SetFloat("Velocity",velo.magnitude); - animator.SetBool ("Fall", !canJump); - if (curDirection != Input.GetAxisRaw (HorizontalBtn)) - applyPlayerDirection (Input.GetAxisRaw (HorizontalBtn)); - - if (displayedHealth != health) { - updateHealth = true; - } - if (updateHealth) - displayHealth (health); - - if (health == 0) - death(); - - if (Input.GetKey (KeyCode.W)){ - if (canJump == true){ - rigidbody2D.velocity = jumpVector; - canJump = false; - } - } - - //if (Input.GetKey (KeyCode.Space)){ - //shoot - //GameObject bulletGO = Instantiate (bullet) as GameObject; - //bulletGO.transform.posplayteition = transform.position; - //} - } - - private void displayHealth(int health){ - GameObject[] hearts = GameObject.FindGameObjectsWithTag("heartUI"); - foreach (GameObject desHeart in hearts) - GameObject.Destroy (desHeart); - - for (int i=1; i<= health; i++) { - GameObject heartCanister = Instantiate (heart) as GameObject; - Vector3 heartPos = new Vector3 ((i * 0.033f), 0.95f, 0); - heartCanister.transform.position = heartPos; - } - displayedHealth = health; - updateHealth = false; - } - //Changes direction of sprite according to key pressed - private void applyPlayerDirection(float moveHorizontal) - { - if (moveHorizontal != 0) - { - transform.Rotate(0,180,0); - curDirection = moveHorizontal; - } - } - - private void Confettishoot(Vector3 target,float size){ - Debug.Log ("Creating Confetti"); - - target.y += 1.5f; - for (int i = 0; i col.transform.position.y){ - col.gameObject.GetComponent().health --; - Confettishoot(col.gameObject.transform.position,20.0f); - - //health --; - rigidbody2D.velocity = jumpVector; - canJump = false; - } - } - } - - -} \ No newline at end of file diff --git a/playable/Assets/Scripts/player2_controls.cs.meta b/playable/Assets/Scripts/player2_controls.cs.meta deleted file mode 100644 index 746abb2..0000000 --- a/playable/Assets/Scripts/player2_controls.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: e1ccee01ee999524e8c0e99f0e5ac3d8 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/playable/Assets/Scripts/playerController.cs b/playable/Assets/Scripts/playerController.cs index fe2aacd..007a78e 100644 --- a/playable/Assets/Scripts/playerController.cs +++ b/playable/Assets/Scripts/playerController.cs @@ -11,7 +11,9 @@ public class playerController : MonoBehaviour { public Animator animator; //Holds animator for Pinata public GameObject heart; //Health sprites public GameObject newConfetti; //confetti when hit + public GameObject newCandy; public stickController stick; //controller for stick + public GUIText scoreDisplay; public float runSpeed; //run speed public float jumpHeight; //jump height @@ -30,6 +32,7 @@ public class playerController : MonoBehaviour { private bool isSpinning = false; //checks if player is spin attacking private float lastHit; private float lastAttack; + private int score; void Start(){ @@ -118,6 +121,9 @@ public class playerController : MonoBehaviour { //respawns player if they die private void death(){ if (health <= 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 @@ -177,6 +183,17 @@ public class playerController : MonoBehaviour { } } + void OnTriggerEnter2D(Collider2D trig) + { + Debug.Log (trig.gameObject.tag); + if (trig.gameObject.tag == "candy") + { + trig.gameObject.SetActive (false); + score++; + scoreDisplay.text = "score: " + score.ToString (); + } + } + diff --git a/playable/Assets/Scripts/sc.cs b/playable/Assets/Scripts/sc.cs deleted file mode 100644 index 48d9bfc..0000000 --- a/playable/Assets/Scripts/sc.cs +++ /dev/null @@ -1,16 +0,0 @@ -using UnityEngine; -using System.Collections; - -public class sc : MonoBehaviour { - Quaternion rotation; - - // Use this for initialization - void Awake () { - rotation = transform.rotation; - } - - // Update is called once per frame - void LateUpdate () { - transform.rotation = rotation; - } -} diff --git a/playable/Assets/Scripts/sc.cs.meta b/playable/Assets/Scripts/sc.cs.meta deleted file mode 100644 index 6a19955..0000000 --- a/playable/Assets/Scripts/sc.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 8664bb421145d654e8a7367a64b7ca5e -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/playable/Assets/stickController.cs b/playable/Assets/Scripts/stickController.cs similarity index 100% rename from playable/Assets/stickController.cs rename to playable/Assets/Scripts/stickController.cs diff --git a/playable/Assets/stickController.cs.meta b/playable/Assets/Scripts/stickController.cs.meta similarity index 100% rename from playable/Assets/stickController.cs.meta rename to playable/Assets/Scripts/stickController.cs.meta diff --git a/playable/ProjectSettings/InputManager.asset b/playable/ProjectSettings/InputManager.asset index d1c057c..1909082 100644 Binary files a/playable/ProjectSettings/InputManager.asset and b/playable/ProjectSettings/InputManager.asset differ diff --git a/playable/ProjectSettings/TagManager.asset b/playable/ProjectSettings/TagManager.asset index 1d4d8c2..7bf66d9 100644 Binary files a/playable/ProjectSettings/TagManager.asset and b/playable/ProjectSettings/TagManager.asset differ