Skip to content

Commit

Permalink
Merge pull request #491 from CSE3902-Group-3/Fix-goriya-flashing-bug
Browse files Browse the repository at this point in the history
Fix goriya flashing and door bugs
  • Loading branch information
gdifiore authored Dec 6, 2023
2 parents 01a6215 + 24c56dc commit 094f02a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Door/BombableDoor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ private void HandleCollisionWhenLocked(CollisionInfo collision)

private void HandleCollisionWhenUnlocked(CollisionInfo collision)
{
if (collision.CollidedWith.Layer != CollisionLayer.Player && GameState.Link.StateMachine.isKnockedBack) return;
if (collision.CollidedWith.Layer != CollisionLayer.Player || GameState.Link.StateMachine.isKnockedBack) return;
GameState.Link.StateMachine.prevDirection = GameState.Link.StateMachine.currentDirection;
GameState.Link.StateMachine.currentDirection = direction;
GameState.Link.EnterRoomTransition();
Expand Down
10 changes: 8 additions & 2 deletions Enemies/Goriya.cs
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,10 @@ public void OnCollision(List<CollisionInfo> collisions)
{
EnemyUtilities.HandleWeaponCollision(this, GetType(), collision);
CurrentCooldown = EnemyUtilities.DAMAGE_COOLDOWN; // Reset the cooldown timer
Sprites[CurrentSprite].flashing = true;
for(int i = 0; i < Sprites.Count; i++)
{
Sprites[i].flashing = true;
}
new Timer(1.0f, StopFlashing);
}
}
Expand All @@ -180,7 +183,10 @@ public void CompleteStun()
}
public void StopFlashing()
{
Sprites[CurrentSprite].flashing = false;
for (int i = 0; i < Sprites.Count; i++)
{
Sprites[i].flashing = false;
}
}
public void DropItem()
{
Expand Down

0 comments on commit 094f02a

Please sign in to comment.