|
|
@ -24,7 +24,13 @@ class Boundaries extends Forge2DBlueprint {
|
|
|
|
/// {@endtemplate bottom_boundary}
|
|
|
|
/// {@endtemplate bottom_boundary}
|
|
|
|
class _BottomBoundary extends BodyComponent with InitialPosition {
|
|
|
|
class _BottomBoundary extends BodyComponent with InitialPosition {
|
|
|
|
/// {@macro bottom_boundary}
|
|
|
|
/// {@macro bottom_boundary}
|
|
|
|
_BottomBoundary() : super(priority: 1);
|
|
|
|
_BottomBoundary()
|
|
|
|
|
|
|
|
: super(
|
|
|
|
|
|
|
|
priority: 1,
|
|
|
|
|
|
|
|
children: [_BottomBoundarySpriteComponent()],
|
|
|
|
|
|
|
|
) {
|
|
|
|
|
|
|
|
renderBody = false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
List<FixtureDef> _createFixtureDefs() {
|
|
|
|
List<FixtureDef> _createFixtureDefs() {
|
|
|
|
final fixturesDefs = <FixtureDef>[];
|
|
|
|
final fixturesDefs = <FixtureDef>[];
|
|
|
@ -60,13 +66,6 @@ class _BottomBoundary extends BodyComponent with InitialPosition {
|
|
|
|
|
|
|
|
|
|
|
|
return body;
|
|
|
|
return body;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
|
|
|
Future<void> onLoad() async {
|
|
|
|
|
|
|
|
await super.onLoad();
|
|
|
|
|
|
|
|
renderBody = false;
|
|
|
|
|
|
|
|
await add(_BottomBoundarySpriteComponent());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
class _BottomBoundarySpriteComponent extends SpriteComponent with HasGameRef {
|
|
|
|
class _BottomBoundarySpriteComponent extends SpriteComponent with HasGameRef {
|
|
|
@ -89,7 +88,13 @@ class _BottomBoundarySpriteComponent extends SpriteComponent with HasGameRef {
|
|
|
|
/// {@endtemplate outer_boundary}
|
|
|
|
/// {@endtemplate outer_boundary}
|
|
|
|
class _OuterBoundary extends BodyComponent with InitialPosition {
|
|
|
|
class _OuterBoundary extends BodyComponent with InitialPosition {
|
|
|
|
/// {@macro outer_boundary}
|
|
|
|
/// {@macro outer_boundary}
|
|
|
|
_OuterBoundary() : super(priority: Ball.launchRampPriority - 1);
|
|
|
|
_OuterBoundary()
|
|
|
|
|
|
|
|
: super(
|
|
|
|
|
|
|
|
priority: Ball.launchRampPriority - 1,
|
|
|
|
|
|
|
|
children: [_OuterBoundarySpriteComponent()],
|
|
|
|
|
|
|
|
) {
|
|
|
|
|
|
|
|
renderBody = false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
List<FixtureDef> _createFixtureDefs() {
|
|
|
|
List<FixtureDef> _createFixtureDefs() {
|
|
|
|
final fixturesDefs = <FixtureDef>[];
|
|
|
|
final fixturesDefs = <FixtureDef>[];
|
|
|
@ -131,13 +136,6 @@ class _OuterBoundary extends BodyComponent with InitialPosition {
|
|
|
|
|
|
|
|
|
|
|
|
return body;
|
|
|
|
return body;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
|
|
|
Future<void> onLoad() async {
|
|
|
|
|
|
|
|
await super.onLoad();
|
|
|
|
|
|
|
|
renderBody = false;
|
|
|
|
|
|
|
|
await add(_OuterBoundarySpriteComponent());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
class _OuterBoundarySpriteComponent extends SpriteComponent with HasGameRef {
|
|
|
|
class _OuterBoundarySpriteComponent extends SpriteComponent with HasGameRef {
|
|
|
|