Skip to content
This repository has been archived by the owner on Mar 13, 2024. It is now read-only.

Commit

Permalink
refactor: adjusted logic
Browse files Browse the repository at this point in the history
  • Loading branch information
alestiago committed Mar 10, 2024
1 parent c14600e commit 07de104
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,6 @@ class PlayerHintingBehavior extends Behavior<Player>
@override
void update(double dt) {
super.update(dt);
if (bloc.state.status != GameStatus.playing) {
return;
}

if (_trash.isEmpty || _closestTrash == null) {
// If there is no trash, no hint is needed and thus, the behavior can be
Expand All @@ -113,6 +110,10 @@ class PlayerHintingBehavior extends Behavior<Player>
return;
}

if (bloc.state.status != GameStatus.playing) {
return;
}

_lastVisibleTrash = _isTrashVisible ? 0 : _lastVisibleTrash + dt;
_lastHint += dt;

Expand Down

0 comments on commit 07de104

Please sign in to comment.