|
|
@ -31,6 +31,11 @@ public class playerController : MonoBehaviour { |
|
|
|
public float dashTime; |
|
|
|
public float dashWait; |
|
|
|
public float minY; |
|
|
|
public float deathTimer = 3.0f; |
|
|
|
public Vector3 respawnArea; |
|
|
|
public Vector2 randRes; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private float displayedHealth = 3; //currently displayed health
|
|
|
@ -47,8 +52,8 @@ public class playerController : MonoBehaviour { |
|
|
|
private bool canDash = true; |
|
|
|
private float lastDash = 0.0f; |
|
|
|
private bool stopDash = false; |
|
|
|
public float deathTimer = 3.0f; |
|
|
|
bool droppedCandy = false; |
|
|
|
private bool droppedCandy = false; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -180,7 +185,10 @@ public class playerController : MonoBehaviour { |
|
|
|
//gameObject.active = true;
|
|
|
|
|
|
|
|
|
|
|
|
Vector3 spawnPos = new Vector3 (Random.Range (-20.0f, 20.0f), 15.0f, 0); //picks random position
|
|
|
|
|
|
|
|
//Vector3 spawnPos = new Vector3 (Random.Range (-20.0f, 20.0f), 15.0f, 0); //picks random position
|
|
|
|
Vector3 spawnPos = respawnArea; |
|
|
|
spawnPos.x = Random.Range(randRes.x,randRes.y); |
|
|
|
health = 3; //resets life
|
|
|
|
transform.position = spawnPos; //changes position
|
|
|
|
rigidbody2D.velocity = Vector2.zero; |
|
|
|