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