lots of small changes lol
worked on tambourine level layout, improved tambourine throwing, created enemy respawn system
This commit is contained in:
@@ -179,7 +179,7 @@ public class PlayerBehavior : MonoBehaviour
|
||||
void OnCollisionEnter2D(Collision2D collision) {
|
||||
if (collision.gameObject.tag == "Enemy") {
|
||||
if (collision.transform.position.y < transform.position.y) {
|
||||
Destroy(collision.gameObject);
|
||||
collision.gameObject.GetComponent<EnemyPatrol>().DefeatEnemy();
|
||||
} else {
|
||||
DestroyPlayer();
|
||||
}
|
||||
@@ -192,6 +192,13 @@ public class PlayerBehavior : MonoBehaviour
|
||||
|
||||
public void DestroyPlayer() {
|
||||
this.stateController.SetDeathCanvasActive(true);
|
||||
|
||||
// destroy all tambourines
|
||||
GameObject[] currentTambourines = GameObject.FindGameObjectsWithTag("tambourine");
|
||||
foreach (GameObject tambourine in currentTambourines) {
|
||||
tambourine.GetComponent<TambourineBehavior>().DestroySelf();
|
||||
}
|
||||
|
||||
Destroy(this.gameObject);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user