|
|
|
@ -3,6 +3,9 @@
|
|
|
|
|
import 'package:flame_forge2d/flame_forge2d.dart';
|
|
|
|
|
import 'package:pinball/game/components/components.dart';
|
|
|
|
|
|
|
|
|
|
/// {@template wall}
|
|
|
|
|
/// A continuos generic and [BodyType.static] barrier that divides a game area.
|
|
|
|
|
/// {@endtemplate}
|
|
|
|
|
class Wall extends BodyComponent {
|
|
|
|
|
Wall({
|
|
|
|
|
required this.start,
|
|
|
|
@ -29,6 +32,12 @@ class Wall extends BodyComponent {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// {@template bottom_wall}
|
|
|
|
|
/// [Wall] located at the bottom of the board.
|
|
|
|
|
///
|
|
|
|
|
/// Collisions with [BottomWall] are listened by
|
|
|
|
|
/// [BottomWallBallContactCallback].
|
|
|
|
|
/// {@endtemplate}
|
|
|
|
|
class BottomWall extends Wall {
|
|
|
|
|
BottomWall(Forge2DGame game)
|
|
|
|
|
: super(
|
|
|
|
@ -40,6 +49,9 @@ class BottomWall extends Wall {
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// {@template bottom_wall_ball_contact_callback}
|
|
|
|
|
/// Listens when a [Ball] falls into a [BottomWall].
|
|
|
|
|
/// {@endtemplate}
|
|
|
|
|
class BottomWallBallContactCallback extends ContactCallback<Ball, BottomWall> {
|
|
|
|
|
@override
|
|
|
|
|
void begin(Ball ball, BottomWall wall, Contact contact) {
|
|
|
|
|