update method

  1. @mustCallSuper
  2. @override
void update(
  1. double dt
)
@mustCallSuper, override

This method is called periodically by the game engine to request that your component updates itself.

The time t in seconds (with microseconds precision provided by Flutter) since the last update cycle. This time can vary according to hardware capacity, so make sure to update your state considering this. All components on BaseGame are always updated by the same amount. The time each one takes to update adds up to the next update cycle.

Implementation

@mustCallSuper
@override
void update(double dt) {
  _effects.forEach((e) => e.update(dt));
  _effects.removeWhere((e) => e.hasFinished());
}