lots of small changes lol

worked on tambourine level layout, improved tambourine throwing, created enemy respawn system
This commit is contained in:
slevy14
2023-04-29 14:51:50 -07:00
parent ed3fcf541c
commit 405e20ca2f
11 changed files with 10894 additions and 528 deletions

View File

@@ -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);
}
}