|
|
@ -3,10 +3,16 @@
|
|
|
|
import 'package:flame_forge2d/flame_forge2d.dart';
|
|
|
|
import 'package:flame_forge2d/flame_forge2d.dart';
|
|
|
|
import 'package:pinball/game/game.dart';
|
|
|
|
import 'package:pinball/game/game.dart';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// {@template score_points}
|
|
|
|
|
|
|
|
/// Specifies the amount of points received on [Ball] collision.
|
|
|
|
|
|
|
|
/// {@endtemplate}
|
|
|
|
mixin ScorePoints {
|
|
|
|
mixin ScorePoints {
|
|
|
|
|
|
|
|
/// {@macro score_points}
|
|
|
|
int get points;
|
|
|
|
int get points;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// [ContactCallback] that adds points to the score when a [Ball] collides with
|
|
|
|
|
|
|
|
/// a [BodyComponent] that implements [ScorePoints].
|
|
|
|
class BallScorePointsCallback extends ContactCallback<Ball, ScorePoints> {
|
|
|
|
class BallScorePointsCallback extends ContactCallback<Ball, ScorePoints> {
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
void begin(
|
|
|
|
void begin(
|
|
|
|