|
|
@ -21,9 +21,6 @@ class Spaceship extends Forge2DBlueprint {
|
|
|
|
/// The [position] where the elements will be created
|
|
|
|
/// The [position] where the elements will be created
|
|
|
|
final Vector2 position;
|
|
|
|
final Vector2 position;
|
|
|
|
|
|
|
|
|
|
|
|
/// Base priority for wall while be on spaceship.
|
|
|
|
|
|
|
|
static const ballPriorityWhenOnSpaceship = 4;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
void build(_) {
|
|
|
|
void build(_) {
|
|
|
|
addAllContactCallback([
|
|
|
|
addAllContactCallback([
|
|
|
@ -37,7 +34,7 @@ class Spaceship extends Forge2DBlueprint {
|
|
|
|
AndroidHead()..initialPosition = position,
|
|
|
|
AndroidHead()..initialPosition = position,
|
|
|
|
SpaceshipHole(
|
|
|
|
SpaceshipHole(
|
|
|
|
outsideLayer: Layer.spaceshipExitRail,
|
|
|
|
outsideLayer: Layer.spaceshipExitRail,
|
|
|
|
outsidePriority: SpaceshipRail.ballPriorityInsideRail,
|
|
|
|
outsidePriority: Ball.spaceshipRailPriority,
|
|
|
|
)..initialPosition = position - Vector2(5.2, 4.8),
|
|
|
|
)..initialPosition = position - Vector2(5.2, 4.8),
|
|
|
|
SpaceshipHole()..initialPosition = position - Vector2(-7.2, 0.8),
|
|
|
|
SpaceshipHole()..initialPosition = position - Vector2(-7.2, 0.8),
|
|
|
|
SpaceshipWall()..initialPosition = position,
|
|
|
|
SpaceshipWall()..initialPosition = position,
|
|
|
@ -50,8 +47,7 @@ class Spaceship extends Forge2DBlueprint {
|
|
|
|
/// {@endtemplate}
|
|
|
|
/// {@endtemplate}
|
|
|
|
class SpaceshipSaucer extends BodyComponent with InitialPosition, Layered {
|
|
|
|
class SpaceshipSaucer extends BodyComponent with InitialPosition, Layered {
|
|
|
|
/// {@macro spaceship_saucer}
|
|
|
|
/// {@macro spaceship_saucer}
|
|
|
|
SpaceshipSaucer()
|
|
|
|
SpaceshipSaucer() : super(priority: Ball.spaceshipPriority - 1) {
|
|
|
|
: super(priority: Spaceship.ballPriorityWhenOnSpaceship - 1) {
|
|
|
|
|
|
|
|
layer = Layer.spaceship;
|
|
|
|
layer = Layer.spaceship;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -95,7 +91,7 @@ class SpaceshipSaucer extends BodyComponent with InitialPosition, Layered {
|
|
|
|
/// {@endtemplate}
|
|
|
|
/// {@endtemplate}
|
|
|
|
class AndroidHead extends BodyComponent with InitialPosition, Layered {
|
|
|
|
class AndroidHead extends BodyComponent with InitialPosition, Layered {
|
|
|
|
/// {@macro spaceship_bridge}
|
|
|
|
/// {@macro spaceship_bridge}
|
|
|
|
AndroidHead() : super(priority: Spaceship.ballPriorityWhenOnSpaceship + 1) {
|
|
|
|
AndroidHead() : super(priority: Ball.spaceshipPriority + 1) {
|
|
|
|
layer = Layer.spaceship;
|
|
|
|
layer = Layer.spaceship;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -157,7 +153,7 @@ class SpaceshipEntrance extends RampOpening {
|
|
|
|
: super(
|
|
|
|
: super(
|
|
|
|
insideLayer: Layer.spaceship,
|
|
|
|
insideLayer: Layer.spaceship,
|
|
|
|
orientation: RampOrientation.up,
|
|
|
|
orientation: RampOrientation.up,
|
|
|
|
insidePriority: Spaceship.ballPriorityWhenOnSpaceship,
|
|
|
|
insidePriority: Ball.spaceshipPriority,
|
|
|
|
) {
|
|
|
|
) {
|
|
|
|
layer = Layer.spaceship;
|
|
|
|
layer = Layer.spaceship;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -242,7 +238,7 @@ class _SpaceshipWallShape extends ChainShape {
|
|
|
|
/// {@endtemplate}
|
|
|
|
/// {@endtemplate}
|
|
|
|
class SpaceshipWall extends BodyComponent with InitialPosition, Layered {
|
|
|
|
class SpaceshipWall extends BodyComponent with InitialPosition, Layered {
|
|
|
|
/// {@macro spaceship_wall}
|
|
|
|
/// {@macro spaceship_wall}
|
|
|
|
SpaceshipWall() : super(priority: Spaceship.ballPriorityWhenOnSpaceship + 1) {
|
|
|
|
SpaceshipWall() : super(priority: Ball.spaceshipPriority + 1) {
|
|
|
|
layer = Layer.spaceship;
|
|
|
|
layer = Layer.spaceship;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|