diff --git a/Assets/Scenes/Level1.unity b/Assets/Scenes/Level1.unity index f82ae22..35e2eed 100644 Binary files a/Assets/Scenes/Level1.unity and b/Assets/Scenes/Level1.unity differ diff --git a/Assets/Scripts/EnemySpeedFroomController.cs b/Assets/Scripts/EnemySpeedFroomController.cs index e723b58..a256dfd 100644 --- a/Assets/Scripts/EnemySpeedFroomController.cs +++ b/Assets/Scripts/EnemySpeedFroomController.cs @@ -84,6 +84,24 @@ protected override void OnCollisionEnter2D(Collision2D coll) { } } + protected void OnCollisionStay2D(Collision2D coll) { + if (coll.gameObject.tag == "Player") { + if (currState == EnemyState.DOUBLE_SPEED + && base.particleSysStomp.transform.position.y < coll.gameObject.transform.position.y + && !hasHelmet) { + + PlayerController pc = coll.gameObject.GetComponent(); + SetDisabled(); + pc.OnEnemyStomp(); + base.particleSysStomp.Play(); + AudioSource.PlayClipAtPoint(hitAudio, transform.position); + } + else if (currState == EnemyState.DISABLED) { + base.KillEnemy(); + } + } + } + /** * Triggered when enemy is bumped by ground from below. */