mirror of
https://github.com/flame-engine/flame.git
synced 2025-11-01 10:38:17 +08:00
24 lines
453 B
Dart
24 lines
453 B
Dart
import 'dart:ui';
|
|
|
|
import './component.dart';
|
|
import '../time.dart';
|
|
|
|
/// Simple component which wraps a [Timer] instance allowing it to be easily used inside a [BaseGame] game.
|
|
class TimerComponent extends Component {
|
|
Timer timer;
|
|
|
|
TimerComponent(this.timer);
|
|
|
|
@override
|
|
void update(double dt) {
|
|
super.update(dt);
|
|
timer.update(dt);
|
|
}
|
|
|
|
@override
|
|
void render(Canvas canvas) {}
|
|
|
|
@override
|
|
bool destroy() => timer.isFinished();
|
|
}
|