From 3476db45649a8e60c451eaa26688f1c542074140 Mon Sep 17 00:00:00 2001 From: Joshua Reason Date: Tue, 5 May 2015 18:10:44 +1000 Subject: [PATCH] -Merged Player controllers into one tileable script. -Added attacks. -Spotlights now point at player instead of follow them --- playable/Assets/Confetti.prefab | Bin 10288 -> 10288 bytes playable/Assets/Lachlan_jump_work.unity | Bin 155540 -> 147340 bytes playable/Assets/Scripts/PlayerControler.cs | 19 +- playable/Assets/Scripts/confettiController.cs | 2 +- playable/Assets/Scripts/player2_controls.cs | 18 +- playable/Assets/Scripts/playerController.cs | 162 ++++++++++++++++++ .../Assets/Scripts/playerController.cs.meta | 8 + .../Assets/Scripts/spotLightController.cs | 10 ++ .../Scripts/spotLightController.cs.meta | 8 + playable/Assets/stickController.cs | 52 ++++++ playable/Assets/stickController.cs.meta | 8 + playable/ProjectSettings/InputManager.asset | Bin 5664 -> 5680 bytes 12 files changed, 271 insertions(+), 16 deletions(-) create mode 100644 playable/Assets/Scripts/playerController.cs create mode 100644 playable/Assets/Scripts/playerController.cs.meta create mode 100644 playable/Assets/Scripts/spotLightController.cs create mode 100644 playable/Assets/Scripts/spotLightController.cs.meta create mode 100644 playable/Assets/stickController.cs create mode 100644 playable/Assets/stickController.cs.meta diff --git a/playable/Assets/Confetti.prefab b/playable/Assets/Confetti.prefab index e08a543b06b69d566efaf64f0ccdd93eabef219b..fc52f948651ac826d34fbf35de841813b55c56ba 100644 GIT binary patch delta 637 zcmZ8fU279j5S<&uwveVVyL6LKV}&LSr9urwiuA*_K~cJ}Sd=~~x7pix>2`0~tR?ZO z;y>v8fj;_XB)+RpeX$Sy8~zGsZd?!t7G~z0Gw05*!(bQ;zj{k80C=gpIy^Mtpw)&Q z*;DY4npp@=&H<)JH-#&Kmz5e`HzvwQk&!8!yxr5Wl1V#}UARTWJpODr_`6bPQZ*wz zOXQhO2m2ivDN8Fb%{w$Eq7hGZUxnLomoPS)u_K;TJyEpTakVV&a8`ZwJWkh0upcRP zs^hM2!m*^p@O%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*Gs8CGa9omJ~3#{QNX^F zj6XAnYS}|_*=f;WP_t2e)L)`)`5oD~VyWP|-u}Ocmeb&j>z_<($NnZ0-gq`OAALOM z{@r2aw`b#u@t)2t2}Yww+2R9l?Q*&^{h!6nzn`lVO#LKIy|lwVUx^ki3KsrP+6;T~ z|GnUh;<$e*n3mM^)5Z9e-G3~T)h(y5G5)8T(&ZgZ1$pTcanZnE!T~pLeRogy3kA?hy9I}H0 diff --git a/playable/Assets/Scripts/PlayerControler.cs b/playable/Assets/Scripts/PlayerControler.cs index e15c298..4c7cf86 100644 --- a/playable/Assets/Scripts/PlayerControler.cs +++ b/playable/Assets/Scripts/PlayerControler.cs @@ -14,6 +14,7 @@ public class PlayerControler : MonoBehaviour { 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; @@ -27,7 +28,8 @@ public class PlayerControler : MonoBehaviour { rigidbody2D.velocity = velo; animator.SetFloat("Velocity",velo.magnitude); animator.SetBool ("Fall", !canJump); - applyPlayerDirection (Input.GetAxisRaw ("Horizontal_P1")); + if (curDirection != Input.GetAxisRaw ("Horizontal_P1")) + applyPlayerDirection (Input.GetAxisRaw ("Horizontal_P1")); if (displayedHealth != health) { updateHealth = true; @@ -71,9 +73,8 @@ public class PlayerControler : MonoBehaviour { { if (moveHorizontal != 0) { - Vector3 scale = transform.localScale; - scale.x = -moveHorizontal * Mathf.Abs(scale.x); - transform.localScale = scale; + transform.Rotate(0,180,0); + curDirection = moveHorizontal; } } @@ -87,9 +88,11 @@ public class PlayerControler : MonoBehaviour { } private void death(){ - Vector3 spawnPos = new Vector3 (Random.Range (-20.0f, 20.0f), 15.0f, 0); - health = 3; - transform.position = spawnPos; + if (health == 0) { + Vector3 spawnPos = new Vector3 (Random.Range (-20.0f, 20.0f), 15.0f, 0); + health = 3; + transform.position = spawnPos; + } } void OnCollisionEnter2D(Collision2D col){ @@ -99,7 +102,7 @@ public class PlayerControler : MonoBehaviour { canJump = true; if(transform.position.y>col.transform.position.y){ col.gameObject.GetComponent().health --; - Confettishoot(col.gameObject.transform.position,200.0f); + Confettishoot(col.gameObject.transform.position,20.0f); //health --; rigidbody2D.velocity = jumpVector; canJump = false; diff --git a/playable/Assets/Scripts/confettiController.cs b/playable/Assets/Scripts/confettiController.cs index df1bd4a..235e64c 100644 --- a/playable/Assets/Scripts/confettiController.cs +++ b/playable/Assets/Scripts/confettiController.cs @@ -15,7 +15,7 @@ public class confettiController : MonoBehaviour { int randColour = Mathf.FloorToInt (rand); startTime = Time.time; startScale = transform.localScale.x; - rigidbody.velocity = Random.onUnitSphere * speed; + rigidbody2D.velocity = Random.onUnitSphere * speed; switch (randColour) { case 0: diff --git a/playable/Assets/Scripts/player2_controls.cs b/playable/Assets/Scripts/player2_controls.cs index 7efdbf0..c93713b 100644 --- a/playable/Assets/Scripts/player2_controls.cs +++ b/playable/Assets/Scripts/player2_controls.cs @@ -7,28 +7,33 @@ public class player2_controls : MonoBehaviour { 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 ("Horizontal_P2") * speed; + velo.x = Input.GetAxis (HorizontalBtn) * speed; rigidbody2D.velocity = velo; animator.SetFloat("Velocity",velo.magnitude); animator.SetBool ("Fall", !canJump); - applyPlayerDirection (Input.GetAxisRaw ("Horizontal_P2")); + if (curDirection != Input.GetAxisRaw (HorizontalBtn)) + applyPlayerDirection (Input.GetAxisRaw (HorizontalBtn)); if (displayedHealth != health) { updateHealth = true; @@ -71,9 +76,8 @@ public class player2_controls : MonoBehaviour { { if (moveHorizontal != 0) { - Vector3 scale = transform.localScale; - scale.x = moveHorizontal * Mathf.Abs(scale.x); - transform.localScale = scale; + transform.Rotate(0,180,0); + curDirection = moveHorizontal; } } @@ -99,7 +103,7 @@ public class player2_controls : MonoBehaviour { else if (col.collider.tag == "Player") { if(transform.position.y>col.transform.position.y){ col.gameObject.GetComponent().health --; - Confettishoot(col.gameObject.transform.position,200.0f); + Confettishoot(col.gameObject.transform.position,20.0f); //health --; rigidbody2D.velocity = jumpVector; diff --git a/playable/Assets/Scripts/playerController.cs b/playable/Assets/Scripts/playerController.cs new file mode 100644 index 0000000..e560130 --- /dev/null +++ b/playable/Assets/Scripts/playerController.cs @@ -0,0 +1,162 @@ +using UnityEngine; +using System.Collections; +using System.Collections.Generic; //input for lists + +public class playerController : MonoBehaviour { + + public string HorizontalBtn; //holds string for horizontal input + public string VerticalBtn; //holds string for Vertical input + public string StrongAttackBtn; + + public Animator animator; //Holds animator for Pinata + public GameObject heart; //Health sprites + public GameObject newConfetti; //confetti when hit + public stickController stick; //controller for stick + + public float runSpeed; //run speed + public float jumpHeight; //jump height + public float health; //holds health + public int confettiOnHit; //amount of confetti created on hit + public Vector2 healthPos; + + private float displayedHealth = 3; //currently displayed health + private bool updateHealth = true; //if the health bar needs updating + private float curDirection = -1; //direction player is pointing + private bool canJump = true; // if player can jump + private List hearts = new List (); //list which holds health sprites; + private bool isSpinning = false; //checks if player is spin attacking + + + void Start(){ + if (transform.rotation.y == 180) + curDirection = -1; + else + curDirection = 1; + + } + + + // Update is called once per frame + void Update () { + + displayHealth (); + death (); + applyPlayerDirection (Input.GetAxisRaw (HorizontalBtn)); + } + + void FixedUpdate() { + + /* + * Movement inputs + */ + Vector2 velocity = rigidbody2D.velocity; + velocity.x = Input.GetAxis (HorizontalBtn) * runSpeed; //Horizontal input + + if ((Input.GetAxisRaw (VerticalBtn) == 1) && (canJump)) //Vertical input + { + velocity.y = jumpHeight; + canJump = false; + }//end if + + if (Input.GetAxisRaw (StrongAttackBtn)==1) { + if (!isSpinning) + StartCoroutine (spinAttack (Vector3.down * 360, 0.2f)); + } + + + + rigidbody2D.velocity = velocity; //apply inputs + animator.SetFloat("Velocity",velocity.magnitude);//inputs for animator + animator.SetBool ("Fall", !canJump); + + + }//end fixed update + + private void displayHealth(){ + + if (displayedHealth != health) //check if health needs updating + updateHealth = true; + + if (updateHealth){ + foreach (GameObject desHeart in hearts) //Destroy all heart sprites + GameObject.Destroy (desHeart); + hearts.Clear(); //sets list to zero + + for (int i=1; i<= health; i++) { //creates new heart sprite for each health + GameObject heartCanister = Instantiate (heart) as GameObject; //creat heart sprite + Vector3 heartPos = new Vector3 (); + + //set position + if (healthPos.x == 1) + heartPos.x = (i * 0.033f); + else + heartPos.x = 1-(i * 0.033f); + + if (healthPos.y == 1) + heartPos.y = 0.95f; + else + heartPos.y = 0.05f; + + heartCanister.transform.position = heartPos; + hearts.Add(heartCanister); //adds heart to list + }//end for + + displayedHealth = health; + updateHealth = false; + }//end if + + }//end displayHealth + + //respawns player if they die + private void death(){ + if (health <= 0) { + 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 + }//end if + }//end death + + private void applyPlayerDirection(float moveHorizontal) + { + + if ((curDirection != moveHorizontal) && (moveHorizontal != 0) && !isSpinning) //if player movement direction vs displayed direction + { + transform.Rotate(0,180,0); //rotates player + curDirection = moveHorizontal; //updates direction + } + } + + IEnumerator spinAttack(Vector3 byAngles, float inTime) { + isSpinning = true; + stick.isAttacking = true; + Debug.Log ("" + gameObject.name + "spinning"); + Quaternion startAngle = transform.rotation; + Quaternion endAngle = Quaternion.Euler(transform.eulerAngles + byAngles); + float direction = transform.eulerAngles.y; + + for(float i = 0; i < 1; i += Time.deltaTime/inTime) { + transform.rotation = Quaternion.Euler(0,direction,Mathf.Lerp(0,360,i)); + yield return null; + + } + transform.eulerAngles = new Vector3 (0,direction,0); + Debug.Log ("" + gameObject.name + "End spin"); + isSpinning = false; + stick.isAttacking = false; + } + + + void OnCollisionEnter2D(Collision2D col){ + if (col.collider.tag == "ground") + canJump = true; + else if (col.collider.tag == "Player") { + canJump = true; + } + } + + + + + + +} diff --git a/playable/Assets/Scripts/playerController.cs.meta b/playable/Assets/Scripts/playerController.cs.meta new file mode 100644 index 0000000..a71b0e5 --- /dev/null +++ b/playable/Assets/Scripts/playerController.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: feb419ae5508b15478825d388564e732 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/playable/Assets/Scripts/spotLightController.cs b/playable/Assets/Scripts/spotLightController.cs new file mode 100644 index 0000000..7dfd8bb --- /dev/null +++ b/playable/Assets/Scripts/spotLightController.cs @@ -0,0 +1,10 @@ +using UnityEngine; +using System.Collections; + +public class spotLightController : MonoBehaviour { + + public Transform target; + void Update() { + transform.LookAt(target); + } +} diff --git a/playable/Assets/Scripts/spotLightController.cs.meta b/playable/Assets/Scripts/spotLightController.cs.meta new file mode 100644 index 0000000..cbf6971 --- /dev/null +++ b/playable/Assets/Scripts/spotLightController.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 72c6d3c5f1bbc484bbf1d4932cb997d9 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/playable/Assets/stickController.cs b/playable/Assets/stickController.cs new file mode 100644 index 0000000..d413aa0 --- /dev/null +++ b/playable/Assets/stickController.cs @@ -0,0 +1,52 @@ +using UnityEngine; +using System.Collections; + +public class stickController : MonoBehaviour { + + public GameObject newConfetti; + + public bool isAttacking; + public bool isSpinning; + + // Use this for initialization + void Start () { + + } + + // Update is called once per frame + void Update () { + if (isAttacking) { + gameObject.GetComponent ().enabled = true; + gameObject.GetComponent ().enabled = true; + } else { + gameObject.GetComponent ().enabled = false; + gameObject.GetComponent ().enabled = false; + } + } + + private void Confettishoot(Vector3 target,int size){ //creates confetti + Debug.Log ("Creating Confetti"); + + target.y += 1.5f; + for (int i = 0; i col.transform.position.y){ + if (isAttacking){ + col.gameObject.GetComponent().health --; + Confettishoot(col.gameObject.transform.position,col.gameObject.GetComponent().confettiOnHit); + Vector2 velocity = col.rigidbody.velocity; + velocity.y = 22; + col.rigidbody.velocity = velocity; + } + } + + } + } + + +} diff --git a/playable/Assets/stickController.cs.meta b/playable/Assets/stickController.cs.meta new file mode 100644 index 0000000..d3ae9f1 --- /dev/null +++ b/playable/Assets/stickController.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 34ac62105d880784f9e51ad9f26a0111 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/playable/ProjectSettings/InputManager.asset b/playable/ProjectSettings/InputManager.asset index 9c16f77304b8f1529ab43d57f077b20c2ee5d2a8..3320af6415ef1fedf568ff441e0967b7f450e2a1 100644 GIT binary patch delta 144 zcmZ3Wvq49afq^ZNfkDiGfq{XOfk6OBF)*0undzBql=NofG+<+3;022CZZ2e-%sIJ% zjb$^7fB++BF;I*Vh|4F-3aaaZR0J1f<~f#>BqnFa2N(kR$N*?CLs4dWMu|dVPRZm< PL45&q9h(;jHn0EyaSIy* delta 107 zcmdm>vp`3Zfq^ZNfk8}xfq{XOfk6OBF)*0undupCl=NofRA6IZ;022CZZ2e-%sIJ% zjb$^7fB++BIZ%udh>Iu73aU>w5aF2oL|A|qXaGY_YFddxa!FCn