fuseTimer function

Timer fuseTimer(
  1. double limit,
  2. FuseTimerFn fn, {
  3. bool repeat = false,
  4. bool autoStart = true,
})

Adds a Flame Timer to a Fuse component.

Implementation

Timer fuseTimer(
  double limit,
  FuseTimerFn fn, {
  bool repeat = false,
  bool autoStart = true,
}) {
  final timer = Timer(
    limit,
    onTick: fn,
    repeat: repeat,
    autoStart: autoStart,
  );

  fuseUpdate(timer.update);
  return timer;
}