Skip to content

Commit

Permalink
paused2
Browse files Browse the repository at this point in the history
  • Loading branch information
saidaHF committed Apr 11, 2021
1 parent d720910 commit 049340f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions Assets/Scripts/CharacterController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ private IEnumerator touchAndDamage(float waitTime) {

public void Respawn() {
gameObject.transform.position = new Vector2(RespawnPoint.transform.position.x, RespawnPoint.transform.position.y);
gameObject.GetComponent<HealthController>().actualHP = 3;
}
}

Expand Down
2 changes: 1 addition & 1 deletion Assets/Scripts/HealthController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ void Update() {
// Function DoDamage: -1 HP and destroy of gameObject if die (HP == 0)
public void DoDamage() {
if (--actualHP <= 0) {
if (!(gameObject.tag == "Player")) {
if (gameObject.tag != "Player") {
// Only enemies
Destroy(gameObject);
}
Expand Down

0 comments on commit 049340f

Please sign in to comment.