fix: set userData for ScorePoints #67

pull/77/head
Alejandro Santiago 3 years ago committed by GitHub
parent ed36a162d6
commit d5f41277c8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -9,6 +9,12 @@ import 'package:pinball/game/game.dart';
mixin ScorePoints on BodyComponent { mixin ScorePoints on BodyComponent {
/// {@macro score_points} /// {@macro score_points}
int get points; int get points;
@override
Future<void> onLoad() async {
await super.onLoad();
body.userData = this;
}
} }
/// Adds points to the score when a [Ball] collides with a [BodyComponent] that /// Adds points to the score when a [Ball] collides with a [BodyComponent] that

Loading…
Cancel
Save