This commit is contained in:
2020-02-02 13:41:52 -05:00
parent d56af3e3e3
commit b0f14d6f98
3 changed files with 529 additions and 11 deletions

View File

@@ -74,10 +74,12 @@ public class BugMovement : MonoBehaviour
public void DisableMovement()
{
isMovementDisabled = true;
rigidBody.constraints = RigidbodyConstraints2D.FreezeAll;
}
public void EnableMovement()
{
isMovementDisabled = false;
rigidBody.constraints = RigidbodyConstraints2D.FreezeRotation | RigidbodyConstraints2D.FreezePositionY;
}
}

View File

@@ -80,10 +80,9 @@ public class Player : MonoBehaviour
{
if (coll.gameObject.tag == "Pizza")
{
//Destroy(coll.gameObject);
//currentHealth += currentHealth < startHealth ? 1 : 0;
//healthBar.size = new Vector2(1.5f * currentHealth, this.healthBar.size.y);
Hurt();
Destroy(coll.gameObject);
currentHealth += currentHealth < startHealth ? 1 : 0;
healthBar.size = new Vector2(1.5f * currentHealth, this.healthBar.size.y);
}
else if (coll.gameObject.tag == "Coffee")
{