Added explosion on enemy defeat
Also added a little force for when you land on an enemy, but sometimes it YEETS the player if done at the right moment with a trumpet jump
This commit is contained in:
@@ -179,6 +179,7 @@ public class PlayerBehavior : MonoBehaviour
|
||||
void OnCollisionEnter2D(Collision2D collision) {
|
||||
if (collision.gameObject.tag == "Enemy") {
|
||||
if (collision.transform.position.y < transform.position.y) {
|
||||
_rb.AddForce(Vector2.up * 8, ForceMode2D.Impulse);
|
||||
collision.gameObject.GetComponent<EnemyPatrol>().DefeatEnemy();
|
||||
} else {
|
||||
DestroyPlayer();
|
||||
|
||||
Reference in New Issue
Block a user