Browse Source

Added winning screen

master
Joshua Reason 9 years ago
parent
commit
4cd88c6ea8
2 changed files with 10 additions and 0 deletions
  1. BIN
      playable/Assets/Lachlan_jump_work.unity
  2. +10
    -0
      playable/Assets/Scripts/playerController.cs

BIN
playable/Assets/Lachlan_jump_work.unity View File


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

@ -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() {

Loading…
Cancel
Save