Skip to content

Commit

Permalink
Quick fix for Speed Frooms not getting disabled when player is standi…
Browse files Browse the repository at this point in the history
…ng on top
  • Loading branch information
jonuy committed Jul 31, 2014
1 parent a77223d commit 617176b
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
Binary file modified Assets/Scenes/Level1.unity
Binary file not shown.
18 changes: 18 additions & 0 deletions Assets/Scripts/EnemySpeedFroomController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<PlayerController>();
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.
*/
Expand Down

0 comments on commit 617176b

Please sign in to comment.