|
|
@ -39,9 +39,7 @@ class SpaceshipRamp extends Component {
|
|
|
|
_SpaceshipRampForegroundRailing(),
|
|
|
|
_SpaceshipRampForegroundRailing(),
|
|
|
|
SpaceshipRampBase()..initialPosition = Vector2(3.4, -42.5),
|
|
|
|
SpaceshipRampBase()..initialPosition = Vector2(3.4, -42.5),
|
|
|
|
_SpaceshipRampBackgroundRailingSpriteComponent(),
|
|
|
|
_SpaceshipRampBackgroundRailingSpriteComponent(),
|
|
|
|
SpaceshipRampArrowSpriteComponent(
|
|
|
|
SpaceshipRampArrowSpriteComponent(current: bloc.state.hits),
|
|
|
|
current: bloc.state.hits,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
...?children,
|
|
|
|
...?children,
|
|
|
|
],
|
|
|
|
],
|
|
|
|
);
|
|
|
|
);
|
|
|
@ -257,7 +255,6 @@ class SpaceshipRampBoardOpening extends BodyComponent
|
|
|
|
)..applyTo(['outside']),
|
|
|
|
)..applyTo(['outside']),
|
|
|
|
ZIndexContactBehavior(
|
|
|
|
ZIndexContactBehavior(
|
|
|
|
zIndex: ZIndexes.ballOnBoard,
|
|
|
|
zIndex: ZIndexes.ballOnBoard,
|
|
|
|
onBegin: false,
|
|
|
|
|
|
|
|
)..applyTo(['outside']),
|
|
|
|
)..applyTo(['outside']),
|
|
|
|
ZIndexContactBehavior(zIndex: ZIndexes.ballOnSpaceshipRamp)
|
|
|
|
ZIndexContactBehavior(zIndex: ZIndexes.ballOnSpaceshipRamp)
|
|
|
|
..applyTo(['middle', 'inside']),
|
|
|
|
..applyTo(['middle', 'inside']),
|
|
|
@ -277,8 +274,8 @@ class SpaceshipRampBoardOpening extends BodyComponent
|
|
|
|
List<FixtureDef> _createFixtureDefs() {
|
|
|
|
List<FixtureDef> _createFixtureDefs() {
|
|
|
|
final topEdge = EdgeShape()
|
|
|
|
final topEdge = EdgeShape()
|
|
|
|
..set(
|
|
|
|
..set(
|
|
|
|
Vector2(-3.4, -1.2),
|
|
|
|
Vector2(-3.8, -1.2),
|
|
|
|
Vector2(3.4, -1.6),
|
|
|
|
Vector2(3.7, -1.6),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
final bottomEdge = EdgeShape()
|
|
|
|
final bottomEdge = EdgeShape()
|
|
|
|
..set(
|
|
|
|
..set(
|
|
|
@ -437,7 +434,10 @@ class _SpaceshipRampForegroundRailingSpriteComponent extends SpriteComponent
|
|
|
|
@visibleForTesting
|
|
|
|
@visibleForTesting
|
|
|
|
class SpaceshipRampBase extends BodyComponent
|
|
|
|
class SpaceshipRampBase extends BodyComponent
|
|
|
|
with InitialPosition, ContactCallbacks {
|
|
|
|
with InitialPosition, ContactCallbacks {
|
|
|
|
SpaceshipRampBase() : super(renderBody: false);
|
|
|
|
SpaceshipRampBase()
|
|
|
|
|
|
|
|
: super(
|
|
|
|
|
|
|
|
renderBody: false,
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
void preSolve(Object other, Contact contact, Manifold oldManifold) {
|
|
|
|
void preSolve(Object other, Contact contact, Manifold oldManifold) {
|
|
|
|