|
@ -14,6 +14,7 @@ public class playerController : MonoBehaviour { |
|
|
public GameObject newCandy; |
|
|
public GameObject newCandy; |
|
|
public stickController stick; //controller for stick
|
|
|
public stickController stick; //controller for stick
|
|
|
public GUIText scoreDisplay; |
|
|
public GUIText scoreDisplay; |
|
|
|
|
|
public GUIText gameOverDisplay; |
|
|
|
|
|
|
|
|
public float runSpeed; //run speed
|
|
|
public float runSpeed; //run speed
|
|
|
public float jumpHeight; //jump height
|
|
|
public float jumpHeight; //jump height
|
|
@ -51,6 +52,15 @@ public class playerController : MonoBehaviour { |
|
|
death (); |
|
|
death (); |
|
|
applyPlayerDirection (Input.GetAxisRaw (HorizontalBtn)); |
|
|
applyPlayerDirection (Input.GetAxisRaw (HorizontalBtn)); |
|
|
damage (); |
|
|
damage (); |
|
|
|
|
|
if (transform.position.y < -3) |
|
|
|
|
|
health = 0; |
|
|
|
|
|
|
|
|
|
|
|
if (score >= 10) { |
|
|
|
|
|
gameOverDisplay.enabled = true; |
|
|
|
|
|
gameOverDisplay.text = ""+ gameObject.name + " Wins"; |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void FixedUpdate() { |
|
|
void FixedUpdate() { |
|
|