|
|
@ -4,10 +4,7 @@ import 'package:flame_forge2d/flame_forge2d.dart';
|
|
|
|
import 'package:pinball/game/components/components.dart';
|
|
|
|
import 'package:pinball/game/components/components.dart';
|
|
|
|
|
|
|
|
|
|
|
|
/// {@template wall}
|
|
|
|
/// {@template wall}
|
|
|
|
///
|
|
|
|
/// A continuos generic and [BodyType.static] barrier that divides a game area.
|
|
|
|
/// A generic wall component, a static component that can
|
|
|
|
|
|
|
|
/// be used to create more complex structures.
|
|
|
|
|
|
|
|
///
|
|
|
|
|
|
|
|
/// {@endtemplate}
|
|
|
|
/// {@endtemplate}
|
|
|
|
class Wall extends BodyComponent {
|
|
|
|
class Wall extends BodyComponent {
|
|
|
|
Wall({
|
|
|
|
Wall({
|
|
|
@ -36,10 +33,10 @@ class Wall extends BodyComponent {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// {@template bottom_wall}
|
|
|
|
/// {@template bottom_wall}
|
|
|
|
|
|
|
|
/// [Wall] located at the bottom of the [board].
|
|
|
|
///
|
|
|
|
///
|
|
|
|
/// An specifc [Wall] used to create bottom boundary of the
|
|
|
|
/// Collisions with [BottomWall] are listened by
|
|
|
|
/// game board
|
|
|
|
/// [BottomWallBallContactCallback].
|
|
|
|
///
|
|
|
|
|
|
|
|
/// {@endtemplate}
|
|
|
|
/// {@endtemplate}
|
|
|
|
class BottomWall extends Wall {
|
|
|
|
class BottomWall extends Wall {
|
|
|
|
BottomWall(Forge2DGame game)
|
|
|
|
BottomWall(Forge2DGame game)
|
|
|
@ -53,10 +50,7 @@ class BottomWall extends Wall {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// {@template bottom_wall_ball_contact_callback}
|
|
|
|
/// {@template bottom_wall_ball_contact_callback}
|
|
|
|
///
|
|
|
|
/// Listens when a [Ball] falls into a [BottomWall].
|
|
|
|
/// The [ContactCallback] responsible for indentifying when a [Ball]
|
|
|
|
|
|
|
|
/// has fall into the bottom of the board
|
|
|
|
|
|
|
|
///
|
|
|
|
|
|
|
|
/// {@endtemplate}
|
|
|
|
/// {@endtemplate}
|
|
|
|
class BottomWallBallContactCallback extends ContactCallback<Ball, BottomWall> {
|
|
|
|
class BottomWallBallContactCallback extends ContactCallback<Ball, BottomWall> {
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|