Browse Source

-Spin Attack can only be used once in air

-colored trails and spotlights
master
Joshua Reason 9 years ago
parent
commit
5d99fb56cf
17 changed files with 37 additions and 2614 deletions
  1. +1
    -1
      Pinata_Data/PlayerConnectionConfigFile
  2. BIN
      Pinata_Data/mainData
  3. +0
    -2608
      Pinata_Data/output_log.txt
  4. BIN
      Pinata_Data/sharedassets0.assets
  5. BIN
      playable/Assets/Lachlan_jump_work.unity
  6. BIN
      playable/Assets/Materials/GreenTrail.mat
  7. +4
    -0
      playable/Assets/Materials/GreenTrail.mat.meta
  8. BIN
      playable/Assets/Materials/IndigoTrail.mat
  9. +4
    -0
      playable/Assets/Materials/IndigoTrail.mat.meta
  10. BIN
      playable/Assets/Materials/PinkTrail.mat
  11. +4
    -0
      playable/Assets/Materials/PinkTrail.mat.meta
  12. BIN
      playable/Assets/Materials/YelowTrail.mat
  13. +4
    -0
      playable/Assets/Materials/YelowTrail.mat.meta
  14. BIN
      playable/Assets/Pinata.controller
  15. BIN
      playable/Assets/Prefabs/Confetti.prefab
  16. +10
    -1
      playable/Assets/Scripts/confettiController.cs
  17. +10
    -4
      playable/Assets/Scripts/playerController.cs

+ 1
- 1
Pinata_Data/PlayerConnectionConfigFile View File

@ -1 +1 @@
listen 2675528360 0 0
listen 3396129451 0 0

BIN
Pinata_Data/mainData View File


+ 0
- 2608
Pinata_Data/output_log.txt
File diff suppressed because it is too large
View File


BIN
Pinata_Data/sharedassets0.assets View File


BIN
playable/Assets/Lachlan_jump_work.unity View File


BIN
playable/Assets/Materials/GreenTrail.mat View File


+ 4
- 0
playable/Assets/Materials/GreenTrail.mat.meta View File

@ -0,0 +1,4 @@
fileFormatVersion: 2
guid: 62969fd0a21a90d47a81c0c8616f3dc2
NativeFormatImporter:
userData:

BIN
playable/Assets/Materials/IndigoTrail.mat View File


+ 4
- 0
playable/Assets/Materials/IndigoTrail.mat.meta View File

@ -0,0 +1,4 @@
fileFormatVersion: 2
guid: af4d434df47da2a45b2cb41dd01c5a5b
NativeFormatImporter:
userData:

BIN
playable/Assets/Materials/PinkTrail.mat View File


+ 4
- 0
playable/Assets/Materials/PinkTrail.mat.meta View File

@ -0,0 +1,4 @@
fileFormatVersion: 2
guid: 815622912269a4e4cb2472790ff6dde7
NativeFormatImporter:
userData:

BIN
playable/Assets/Materials/YelowTrail.mat View File


+ 4
- 0
playable/Assets/Materials/YelowTrail.mat.meta View File

@ -0,0 +1,4 @@
fileFormatVersion: 2
guid: b3e6bb8917f5f2e47a6427e2b8c1b100
NativeFormatImporter:
userData:

BIN
playable/Assets/Pinata.controller View File


BIN
playable/Assets/Prefabs/Confetti.prefab View File


+ 10
- 1
playable/Assets/Scripts/confettiController.cs View File

@ -50,10 +50,19 @@ public class confettiController : MonoBehaviour {
float newScale = Mathf.Lerp(0, startScale, Time.deltaTime / lifeTime);
transform.localScale = new Vector3(startScale-newScale, startScale-newScale, startScale-newScale);
if (Time.time - startTime > lifeTime) {
if(Time.time - startTime > lifeTime) {
Destroy (gameObject, 0.0f);
}
}
void OnCollisionEnter2D(Collision2D col){
if (col.collider.tag == "ground" && Time.time - startTime > 2) {
gameObject.GetComponent<BoxCollider2D> ().enabled = false;
gameObject.GetComponent<Rigidbody2D> ().isKinematic = true;
}
}
}

+ 10
- 4
playable/Assets/Scripts/playerController.cs View File

@ -29,6 +29,7 @@ public class playerController : MonoBehaviour {
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 bool canSpin = true; // if player can spin
private List<GameObject> hearts = new List<GameObject> (); //list which holds health sprites;
private bool isSpinning = false; //checks if player is spin attacking
private float lastHit;
@ -78,7 +79,8 @@ public class playerController : MonoBehaviour {
}//end if
if (Input.GetAxisRaw (StrongAttackBtn)==1) {
if (!isSpinning && (lastAttack+attackWait) < Time.time){
if (!isSpinning && canSpin && Time.time - lastAttack > attackWait){
velocity.y = jumpHeight;
lastAttack = Time.time;
StartCoroutine (spinAttack (Vector3.down * 360, 0.2f));
}
@ -153,17 +155,18 @@ public class playerController : MonoBehaviour {
private void damage (){
if (isHit) {
gameObject.GetComponent<PolygonCollider2D> ().enabled = false;
gameObject.GetComponentInChildren<PolygonCollider2D> ().enabled = false;
isHit = false;
lastHit = Time.time;
}
if (lastHit+invulTime < Time.time)
gameObject.GetComponent<PolygonCollider2D> ().enabled = true;
gameObject.GetComponentInChildren<PolygonCollider2D> ().enabled = true;
}
IEnumerator spinAttack(Vector3 byAngles, float inTime) {
isSpinning = true;
canSpin = false;
stick.isAttacking = true;
Debug.Log ("" + gameObject.name + "spinning");
Quaternion startAngle = transform.rotation;
@ -186,10 +189,13 @@ public class playerController : MonoBehaviour {
void OnCollisionEnter2D(Collision2D col){
if (col.collider.tag == "ground")
if (col.collider.tag == "ground") {
canJump = true;
canSpin = true;
}
else if (col.collider.tag == "Player") {
canJump = true;
canSpin = true;
}
}

Loading…
Cancel
Save