refactor: add new background and reposition components (#356)

* refactor: new asset and shape resize

* refactor: add background and move components to match

* chore: update goldens

* chore: swap out computer glow

* chore: pubspec
pull/362/head
Allison Ryan 3 years ago committed by GitHub
parent b3136e5857
commit e6005cd735
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -37,19 +37,19 @@ class AndroidAcres extends Component {
ScoringContactBehavior(points: Points.twentyThousand), ScoringContactBehavior(points: Points.twentyThousand),
BumperNoiseBehavior(), BumperNoiseBehavior(),
], ],
)..initialPosition = Vector2(-25, 1.3), )..initialPosition = Vector2(-25.2, 1.5),
AndroidBumper.b( AndroidBumper.b(
children: [ children: [
ScoringContactBehavior(points: Points.twentyThousand), ScoringContactBehavior(points: Points.twentyThousand),
BumperNoiseBehavior(), BumperNoiseBehavior(),
], ],
)..initialPosition = Vector2(-32.8, -9.2), )..initialPosition = Vector2(-32.9, -9.3),
AndroidBumper.cow( AndroidBumper.cow(
children: [ children: [
ScoringContactBehavior(points: Points.twentyThousand), ScoringContactBehavior(points: Points.twentyThousand),
BumperNoiseBehavior(), BumperNoiseBehavior(),
], ],
)..initialPosition = Vector2(-20.5, -13.8), )..initialPosition = Vector2(-20.7, -13),
AndroidSpaceshipBonusBehavior(), AndroidSpaceshipBonusBehavior(),
], ],
); );

@ -39,14 +39,14 @@ class _BottomGroupSide extends Component {
@override @override
Future<void> onLoad() async { Future<void> onLoad() async {
final direction = _side.direction; final direction = _side.direction;
final centerXAdjustment = _side.isLeft ? 0 : -6.66; final centerXAdjustment = _side.isLeft ? -0.45 : -6.8;
final flipper = ControlledFlipper( final flipper = ControlledFlipper(
side: _side, side: _side,
)..initialPosition = Vector2((11.8 * direction) + centerXAdjustment, 43.6); )..initialPosition = Vector2((11.6 * direction) + centerXAdjustment, 43.6);
final baseboard = Baseboard(side: _side) final baseboard = Baseboard(side: _side)
..initialPosition = Vector2( ..initialPosition = Vector2(
(25.58 * direction) + centerXAdjustment, (25.38 * direction) + centerXAdjustment,
28.71, 28.71,
); );
final kicker = Kicker( final kicker = Kicker(
@ -56,7 +56,7 @@ class _BottomGroupSide extends Component {
..applyTo(['bouncy_edge']), ..applyTo(['bouncy_edge']),
], ],
)..initialPosition = Vector2( )..initialPosition = Vector2(
(22.64 * direction) + centerXAdjustment, (22.44 * direction) + centerXAdjustment,
25.1, 25.1,
); );

@ -20,7 +20,7 @@ class DinoDesert extends Component {
ScoringContactBehavior(points: Points.twoHundredThousand) ScoringContactBehavior(points: Points.twoHundredThousand)
..applyTo(['inside_mouth']), ..applyTo(['inside_mouth']),
], ],
)..initialPosition = Vector2(12.6, -6.9), )..initialPosition = Vector2(12.2, -6.9),
_BarrierBehindDino(), _BarrierBehindDino(),
DinoWalls(), DinoWalls(),
Slingshots(), Slingshots(),

@ -44,7 +44,7 @@ class FlutterForestBonusBehavior extends Component
canvas.add( canvas.add(
ControlledBall.bonus( ControlledBall.bonus(
characterTheme: readProvider<CharacterTheme>(), characterTheme: readProvider<CharacterTheme>(),
)..initialPosition = Vector2(29.5, -24.5), )..initialPosition = Vector2(29.2, -24.5),
); );
animatronic.playing = true; animatronic.playing = true;
signpost.bloc.onProgressed(); signpost.bloc.onProgressed();

@ -21,7 +21,7 @@ class FlutterForest extends Component with ZIndex {
ScoringContactBehavior(points: Points.fiveThousand), ScoringContactBehavior(points: Points.fiveThousand),
BumperNoiseBehavior(), BumperNoiseBehavior(),
], ],
)..initialPosition = Vector2(8.35, -58.3), )..initialPosition = Vector2(7.95, -58.35),
DashNestBumper.main( DashNestBumper.main(
children: [ children: [
ScoringContactBehavior(points: Points.twoHundredThousand), ScoringContactBehavior(points: Points.twoHundredThousand),
@ -39,7 +39,7 @@ class FlutterForest extends Component with ZIndex {
ScoringContactBehavior(points: Points.twentyThousand), ScoringContactBehavior(points: Points.twentyThousand),
BumperNoiseBehavior(), BumperNoiseBehavior(),
], ],
)..initialPosition = Vector2(22.3, -46.75), )..initialPosition = Vector2(21.8, -46.75),
DashAnimatronic()..position = Vector2(20, -66), DashAnimatronic()..position = Vector2(20, -66),
FlutterForestBonusBehavior(), FlutterForestBonusBehavior(),
], ],

@ -14,8 +14,8 @@ class Launcher extends Component {
LaunchRamp(), LaunchRamp(),
Flapper(), Flapper(),
ControlledPlunger(compressionDistance: 9.2) ControlledPlunger(compressionDistance: 9.2)
..initialPosition = Vector2(41.2, 43.7), ..initialPosition = Vector2(41, 43.7),
RocketSpriteComponent()..position = Vector2(43, 62.3), RocketSpriteComponent()..position = Vector2(42.8, 62.3),
], ],
); );
} }

@ -14,23 +14,23 @@ class Multipliers extends Component with ZIndex {
: super( : super(
children: [ children: [
Multiplier.x2( Multiplier.x2(
position: Vector2(-19.5, -2), position: Vector2(-19.6, -2),
angle: -15 * math.pi / 180, angle: -15 * math.pi / 180,
), ),
Multiplier.x3( Multiplier.x3(
position: Vector2(13, -9.4), position: Vector2(12.8, -9.4),
angle: 15 * math.pi / 180, angle: 15 * math.pi / 180,
), ),
Multiplier.x4( Multiplier.x4(
position: Vector2(0, -21.2), position: Vector2(-0.3, -21.2),
angle: 0, angle: 3 * math.pi / 180,
), ),
Multiplier.x5( Multiplier.x5(
position: Vector2(-8.5, -28), position: Vector2(-8.9, -28),
angle: -3 * math.pi / 180, angle: -3 * math.pi / 180,
), ),
Multiplier.x6( Multiplier.x6(
position: Vector2(10, -30.7), position: Vector2(9.8, -30.7),
angle: 8 * math.pi / 180, angle: 8 * math.pi / 180,
), ),
MultipliersBehavior(), MultipliersBehavior(),

@ -33,8 +33,8 @@ class SparkyScorch extends Component {
BumperNoiseBehavior(), BumperNoiseBehavior(),
], ],
)..initialPosition = Vector2(-3.3, -52.55), )..initialPosition = Vector2(-3.3, -52.55),
SparkyComputerSensor()..initialPosition = Vector2(-13, -49.9), SparkyComputerSensor()..initialPosition = Vector2(-13.2, -49.9),
SparkyAnimatronic()..position = Vector2(-13.8, -58.2), SparkyAnimatronic()..position = Vector2(-14, -58.2),
SparkyComputer(), SparkyComputer(),
], ],
); );

@ -79,7 +79,7 @@ class PinballGame extends PinballForge2DGame
BoardBackgroundSpriteComponent(), BoardBackgroundSpriteComponent(),
Boundaries(), Boundaries(),
Backbox(leaderboardRepository: leaderboardRepository), Backbox(leaderboardRepository: leaderboardRepository),
GoogleWord(position: Vector2(-4.25, 1.8)), GoogleWord(position: Vector2(-4.45, 1.8)),
Multipliers(), Multipliers(),
Multiballs(), Multiballs(),
SkillShot( SkillShot(

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 MiB

After

Width:  |  Height:  |  Size: 1.3 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 128 KiB

After

Width:  |  Height:  |  Size: 128 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.2 KiB

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 569 KiB

After

Width:  |  Height:  |  Size: 374 KiB

@ -9,7 +9,7 @@ class BoardBackgroundSpriteComponent extends SpriteComponent
BoardBackgroundSpriteComponent() BoardBackgroundSpriteComponent()
: super( : super(
anchor: Anchor.center, anchor: Anchor.center,
position: Vector2(0, -1), position: Vector2(-0.2, 0.1),
) { ) {
zIndex = ZIndexes.boardBackground; zIndex = ZIndexes.boardBackground;
} }

@ -68,7 +68,7 @@ class _BottomBoundarySpriteComponent extends SpriteComponent with HasGameRef {
_BottomBoundarySpriteComponent() _BottomBoundarySpriteComponent()
: super( : super(
anchor: Anchor.center, anchor: Anchor.center,
position: Vector2(-5, 55.6), position: Vector2(-5.2, 55.6),
); );
@override @override

@ -37,46 +37,46 @@ class _DinoTopWall extends BodyComponent with InitialPosition {
List<FixtureDef> _createFixtureDefs() { List<FixtureDef> _createFixtureDefs() {
final topEdgeShape = EdgeShape() final topEdgeShape = EdgeShape()
..set( ..set(
Vector2(29.25, -35.27), Vector2(29.05, -35.27),
Vector2(28.4, -34.77), Vector2(28.2, -34.77),
); );
final topCurveShape = BezierCurveShape( final topCurveShape = BezierCurveShape(
controlPoints: [ controlPoints: [
topEdgeShape.vertex2, topEdgeShape.vertex2,
Vector2(21.35, -28.72), Vector2(21.15, -28.72),
Vector2(23.45, -24.62), Vector2(23.25, -24.62),
], ],
); );
final tunnelTopEdgeShape = EdgeShape() final tunnelTopEdgeShape = EdgeShape()
..set( ..set(
topCurveShape.vertices.last, topCurveShape.vertices.last,
Vector2(30.35, -27.32), Vector2(30.15, -27.32),
); );
final tunnelBottomEdgeShape = EdgeShape() final tunnelBottomEdgeShape = EdgeShape()
..set( ..set(
Vector2(30.75, -23.17), Vector2(30.55, -23.17),
Vector2(25.45, -21.22), Vector2(25.25, -21.22),
); );
final middleEdgeShape = EdgeShape() final middleEdgeShape = EdgeShape()
..set( ..set(
tunnelBottomEdgeShape.vertex2, tunnelBottomEdgeShape.vertex2,
Vector2(27.45, -19.32), Vector2(27.25, -19.32),
); );
final bottomEdgeShape = EdgeShape() final bottomEdgeShape = EdgeShape()
..set( ..set(
middleEdgeShape.vertex2, middleEdgeShape.vertex2,
Vector2(24.65, -15.02), Vector2(24.45, -15.02),
); );
final undersideEdgeShape = EdgeShape() final undersideEdgeShape = EdgeShape()
..set( ..set(
bottomEdgeShape.vertex2, bottomEdgeShape.vertex2,
Vector2(31.75, -13.77), Vector2(31.55, -13.77),
); );
return [ return [
@ -108,7 +108,7 @@ class _DinoTopWallSpriteComponent extends SpriteComponent
with HasGameRef, ZIndex { with HasGameRef, ZIndex {
_DinoTopWallSpriteComponent() _DinoTopWallSpriteComponent()
: super( : super(
position: Vector2(22.75, -38.07), position: Vector2(22.55, -38.07),
) { ) {
zIndex = ZIndexes.dinoTopWall; zIndex = ZIndexes.dinoTopWall;
} }
@ -129,7 +129,7 @@ class _DinoTopWallSpriteComponent extends SpriteComponent
class _DinoTopWallTunnelSpriteComponent extends SpriteComponent class _DinoTopWallTunnelSpriteComponent extends SpriteComponent
with HasGameRef, ZIndex { with HasGameRef, ZIndex {
_DinoTopWallTunnelSpriteComponent() _DinoTopWallTunnelSpriteComponent()
: super(position: Vector2(23.31, -26.01)) { : super(position: Vector2(23.11, -26.01)) {
zIndex = ZIndexes.dinoTopWallTunnel; zIndex = ZIndexes.dinoTopWallTunnel;
} }
@ -162,28 +162,28 @@ class _DinoBottomWall extends BodyComponent with InitialPosition, ZIndex {
List<FixtureDef> _createFixtureDefs() { List<FixtureDef> _createFixtureDefs() {
final topEdgeShape = EdgeShape() final topEdgeShape = EdgeShape()
..set( ..set(
Vector2(32.4, -8.8), Vector2(32.2, -8.8),
Vector2(25, -7.7), Vector2(24.8, -7.7),
); );
final topLeftCurveShape = BezierCurveShape( final topLeftCurveShape = BezierCurveShape(
controlPoints: [ controlPoints: [
topEdgeShape.vertex2, topEdgeShape.vertex2,
Vector2(21.8, -7), Vector2(21.6, -7),
Vector2(29.8, 13.8), Vector2(29.6, 13.8),
], ],
); );
final bottomLeftEdgeShape = EdgeShape() final bottomLeftEdgeShape = EdgeShape()
..set( ..set(
topLeftCurveShape.vertices.last, topLeftCurveShape.vertices.last,
Vector2(31.9, 44.1), Vector2(31.7, 44.1),
); );
final bottomEdgeShape = EdgeShape() final bottomEdgeShape = EdgeShape()
..set( ..set(
bottomLeftEdgeShape.vertex2, bottomLeftEdgeShape.vertex2,
Vector2(37.8, 44.1), Vector2(37.6, 44.1),
); );
return [ return [
@ -219,6 +219,6 @@ class _DinoBottomWallSpriteComponent extends SpriteComponent with HasGameRef {
); );
this.sprite = sprite; this.sprite = sprite;
size = sprite.originalSize / 10; size = sprite.originalSize / 10;
position = Vector2(23.8, -9.5); position = Vector2(23.6, -9.5);
} }
} }

@ -18,9 +18,9 @@ class Flapper extends Component {
children: [ children: [
FlapperSpinningBehavior(), FlapperSpinningBehavior(),
], ],
)..initialPosition = Vector2(4, -69.3), )..initialPosition = Vector2(3.8, -69.3),
_FlapperStructure(), _FlapperStructure(),
_FlapperExit()..initialPosition = Vector2(-0.6, -33.8), _FlapperExit()..initialPosition = Vector2(-0.8, -33.8),
_BackSupportSpriteComponent(), _BackSupportSpriteComponent(),
_FrontSupportSpriteComponent(), _FrontSupportSpriteComponent(),
FlapSpriteAnimationComponent(), FlapSpriteAnimationComponent(),
@ -73,14 +73,14 @@ class _FlapperStructure extends BodyComponent with Layered {
List<FixtureDef> _createFixtureDefs() { List<FixtureDef> _createFixtureDefs() {
final leftEdgeShape = EdgeShape() final leftEdgeShape = EdgeShape()
..set( ..set(
Vector2(1.9, -69.3), Vector2(1.7, -69.3),
Vector2(1.9, -66), Vector2(1.7, -66),
); );
final bottomEdgeShape = EdgeShape() final bottomEdgeShape = EdgeShape()
..set( ..set(
leftEdgeShape.vertex2, leftEdgeShape.vertex2,
Vector2(3.9, -66), Vector2(3.7, -66),
); );
return [ return [
@ -130,7 +130,7 @@ class FlapSpriteAnimationComponent extends SpriteAnimationComponent
FlapSpriteAnimationComponent() FlapSpriteAnimationComponent()
: super( : super(
anchor: Anchor.center, anchor: Anchor.center,
position: Vector2(2.8, -70.7), position: Vector2(2.6, -70.7),
playing: false, playing: false,
) { ) {
zIndex = ZIndexes.flapper; zIndex = ZIndexes.flapper;
@ -173,7 +173,7 @@ class _BackSupportSpriteComponent extends SpriteComponent
_BackSupportSpriteComponent() _BackSupportSpriteComponent()
: super( : super(
anchor: Anchor.center, anchor: Anchor.center,
position: Vector2(2.95, -70.6), position: Vector2(2.75, -70.6),
) { ) {
zIndex = ZIndexes.flapperBack; zIndex = ZIndexes.flapperBack;
} }
@ -196,7 +196,7 @@ class _FrontSupportSpriteComponent extends SpriteComponent
_FrontSupportSpriteComponent() _FrontSupportSpriteComponent()
: super( : super(
anchor: Anchor.center, anchor: Anchor.center,
position: Vector2(2.9, -67.6), position: Vector2(2.7, -67.7),
) { ) {
zIndex = ZIndexes.flapperFront; zIndex = ZIndexes.flapperFront;
} }

@ -40,22 +40,22 @@ class _LaunchRampBase extends BodyComponent with Layered, ZIndex {
final rightStraightShape = EdgeShape() final rightStraightShape = EdgeShape()
..set( ..set(
Vector2(31.4, -61.4), Vector2(31, -61.4),
Vector2(46.5, 68.4), Vector2(46.1, 68.4),
); );
final rightStraightFixtureDef = FixtureDef(rightStraightShape); final rightStraightFixtureDef = FixtureDef(rightStraightShape);
fixturesDef.add(rightStraightFixtureDef); fixturesDef.add(rightStraightFixtureDef);
final leftStraightShape = EdgeShape() final leftStraightShape = EdgeShape()
..set( ..set(
Vector2(27.8, -61.4), Vector2(27.4, -61.4),
Vector2(41.5, 68.4), Vector2(41.1, 68.4),
); );
final leftStraightFixtureDef = FixtureDef(leftStraightShape); final leftStraightFixtureDef = FixtureDef(leftStraightShape);
fixturesDef.add(leftStraightFixtureDef); fixturesDef.add(leftStraightFixtureDef);
final topCurveShape = ArcShape( final topCurveShape = ArcShape(
center: Vector2(20.5, -61.1), center: Vector2(20.1, -61.1),
arcRadius: 11, arcRadius: 11,
angle: 1.6, angle: 1.6,
rotation: 0.1, rotation: 0.1,
@ -64,7 +64,7 @@ class _LaunchRampBase extends BodyComponent with Layered, ZIndex {
fixturesDef.add(topCurveFixtureDef); fixturesDef.add(topCurveFixtureDef);
final bottomCurveShape = ArcShape( final bottomCurveShape = ArcShape(
center: Vector2(19.3, -60.3), center: Vector2(18.9, -60.3),
arcRadius: 8.5, arcRadius: 8.5,
angle: 1.48, angle: 1.48,
rotation: 0.1, rotation: 0.1,
@ -74,16 +74,16 @@ class _LaunchRampBase extends BodyComponent with Layered, ZIndex {
final topStraightShape = EdgeShape() final topStraightShape = EdgeShape()
..set( ..set(
Vector2(3.7, -70.1), Vector2(3.3, -70.1),
Vector2(19.1, -72.1), Vector2(18.7, -72.1),
); );
final topStraightFixtureDef = FixtureDef(topStraightShape); final topStraightFixtureDef = FixtureDef(topStraightShape);
fixturesDef.add(topStraightFixtureDef); fixturesDef.add(topStraightFixtureDef);
final bottomStraightShape = EdgeShape() final bottomStraightShape = EdgeShape()
..set( ..set(
Vector2(3.7, -66.9), Vector2(3.3, -66.9),
Vector2(19.1, -68.8), Vector2(18.7, -68.8),
); );
final bottomStraightFixtureDef = FixtureDef(bottomStraightShape); final bottomStraightFixtureDef = FixtureDef(bottomStraightShape);
fixturesDef.add(bottomStraightFixtureDef); fixturesDef.add(bottomStraightFixtureDef);
@ -113,7 +113,7 @@ class _LaunchRampBaseSpriteComponent extends SpriteComponent with HasGameRef {
this.sprite = sprite; this.sprite = sprite;
size = sprite.originalSize / 10; size = sprite.originalSize / 10;
anchor = Anchor.center; anchor = Anchor.center;
position = Vector2(25.65, 0.7); position = Vector2(25.25, 0.7);
} }
} }
@ -131,7 +131,7 @@ class _LaunchRampBackgroundRailingSpriteComponent extends SpriteComponent
this.sprite = sprite; this.sprite = sprite;
size = sprite.originalSize / 10; size = sprite.originalSize / 10;
anchor = Anchor.center; anchor = Anchor.center;
position = Vector2(25.6, -1.3); position = Vector2(25.2, -1.3);
} }
} }
@ -149,14 +149,14 @@ class _LaunchRampForegroundRailing extends BodyComponent with ZIndex {
final rightStraightShape = EdgeShape() final rightStraightShape = EdgeShape()
..set( ..set(
Vector2(27.6, -57.9), Vector2(27.2, -57.9),
Vector2(38.1, 42.6), Vector2(37.7, 42.6),
); );
final rightStraightFixtureDef = FixtureDef(rightStraightShape); final rightStraightFixtureDef = FixtureDef(rightStraightShape);
fixturesDef.add(rightStraightFixtureDef); fixturesDef.add(rightStraightFixtureDef);
final curveShape = ArcShape( final curveShape = ArcShape(
center: Vector2(20.1, -59.3), center: Vector2(19.7, -59.3),
arcRadius: 7.5, arcRadius: 7.5,
angle: 1.8, angle: 1.8,
rotation: -0.13, rotation: -0.13,
@ -166,8 +166,8 @@ class _LaunchRampForegroundRailing extends BodyComponent with ZIndex {
final topStraightShape = EdgeShape() final topStraightShape = EdgeShape()
..set( ..set(
Vector2(3.7, -66.8), Vector2(3.3, -66.8),
Vector2(19.7, -66.8), Vector2(19.3, -66.8),
); );
final topStraightFixtureDef = FixtureDef(topStraightShape); final topStraightFixtureDef = FixtureDef(topStraightShape);
fixturesDef.add(topStraightFixtureDef); fixturesDef.add(topStraightFixtureDef);
@ -198,6 +198,6 @@ class _LaunchRampForegroundRailingSpriteComponent extends SpriteComponent
this.sprite = sprite; this.sprite = sprite;
size = sprite.originalSize / 10; size = sprite.originalSize / 10;
anchor = Anchor.center; anchor = Anchor.center;
position = Vector2(22.8, 0.5); position = Vector2(22.4, 0.5);
} }
} }

@ -36,8 +36,8 @@ class Multiball extends Component {
Multiball.a({ Multiball.a({
Iterable<Component>? children, Iterable<Component>? children,
}) : this._( }) : this._(
position: Vector2(-23, 7.5), position: Vector2(-23.3, 7.5),
rotation: -24 * math.pi / 180, rotation: -27 * math.pi / 180,
bloc: MultiballCubit(), bloc: MultiballCubit(),
children: children, children: children,
); );
@ -46,8 +46,8 @@ class Multiball extends Component {
Multiball.b({ Multiball.b({
Iterable<Component>? children, Iterable<Component>? children,
}) : this._( }) : this._(
position: Vector2(-7.2, -6.2), position: Vector2(-7.65, -6.2),
rotation: -5 * math.pi / 180, rotation: -2 * math.pi / 180,
bloc: MultiballCubit(), bloc: MultiballCubit(),
children: children, children: children,
); );
@ -56,8 +56,8 @@ class Multiball extends Component {
Multiball.c({ Multiball.c({
Iterable<Component>? children, Iterable<Component>? children,
}) : this._( }) : this._(
position: Vector2(-0.7, -9.3), position: Vector2(-1.1, -9.3),
rotation: 2.7 * math.pi / 180, rotation: 6 * math.pi / 180,
bloc: MultiballCubit(), bloc: MultiballCubit(),
children: children, children: children,
); );
@ -66,8 +66,8 @@ class Multiball extends Component {
Multiball.d({ Multiball.d({
Iterable<Component>? children, Iterable<Component>? children,
}) : this._( }) : this._(
position: Vector2(15, 7), position: Vector2(14.8, 7),
rotation: 24 * math.pi / 180, rotation: 27 * math.pi / 180,
bloc: MultiballCubit(), bloc: MultiballCubit(),
children: children, children: children,
); );

@ -13,15 +13,13 @@ class Slingshots extends Component with ZIndex {
: super( : super(
children: [ children: [
Slingshot( Slingshot(
length: 5.64,
angle: -0.017, angle: -0.017,
spritePath: Assets.images.slingshot.upper.keyName, spritePath: Assets.images.slingshot.upper.keyName,
)..initialPosition = Vector2(22.3, -1.58), )..initialPosition = Vector2(22.7, -0.3),
Slingshot( Slingshot(
length: 3.46,
angle: -0.468, angle: -0.468,
spritePath: Assets.images.slingshot.lower.keyName, spritePath: Assets.images.slingshot.lower.keyName,
)..initialPosition = Vector2(24.7, 6.2), )..initialPosition = Vector2(24.6, 6.1),
], ],
) { ) {
zIndex = ZIndexes.slingshots; zIndex = ZIndexes.slingshots;
@ -34,11 +32,9 @@ class Slingshots extends Component with ZIndex {
class Slingshot extends BodyComponent with InitialPosition { class Slingshot extends BodyComponent with InitialPosition {
/// {@macro slingshot} /// {@macro slingshot}
Slingshot({ Slingshot({
required double length,
required double angle, required double angle,
required String spritePath, required String spritePath,
}) : _length = length, }) : _angle = angle,
_angle = angle,
super( super(
children: [ children: [
_SlinghsotSpriteComponent(spritePath, angle: angle), _SlinghsotSpriteComponent(spritePath, angle: angle),
@ -47,29 +43,28 @@ class Slingshot extends BodyComponent with InitialPosition {
renderBody: false, renderBody: false,
); );
final double _length;
final double _angle; final double _angle;
List<FixtureDef> _createFixtureDefs() { List<FixtureDef> _createFixtureDefs() {
const length = 3.46;
const circleRadius = 1.55; const circleRadius = 1.55;
final topCircleShape = CircleShape()..radius = circleRadius; final topCircleShape = CircleShape()..radius = circleRadius;
topCircleShape.position.setValues(0, -_length / 2); topCircleShape.position.setValues(0, -length / 2);
final bottomCircleShape = CircleShape()..radius = circleRadius; final bottomCircleShape = CircleShape()..radius = circleRadius;
bottomCircleShape.position.setValues(0, _length / 2); bottomCircleShape.position.setValues(0, length / 2);
final leftEdgeShape = EdgeShape() final leftEdgeShape = EdgeShape()
..set( ..set(
Vector2(circleRadius, _length / 2), Vector2(circleRadius, length / 2),
Vector2(circleRadius, -_length / 2), Vector2(circleRadius, -length / 2),
); );
final rightEdgeShape = EdgeShape() final rightEdgeShape = EdgeShape()
..set( ..set(
Vector2(-circleRadius, _length / 2), Vector2(-circleRadius, length / 2),
Vector2(-circleRadius, -_length / 2), Vector2(-circleRadius, -length / 2),
); );
return [ return [

@ -32,18 +32,18 @@ class _ComputerBase extends BodyComponent with InitialPosition, ZIndex {
List<FixtureDef> _createFixtureDefs() { List<FixtureDef> _createFixtureDefs() {
final leftEdge = EdgeShape() final leftEdge = EdgeShape()
..set( ..set(
Vector2(-15.1, -45.9), Vector2(-15.3, -45.9),
Vector2(-15.5, -49.5), Vector2(-15.7, -49.5),
); );
final topEdge = EdgeShape() final topEdge = EdgeShape()
..set( ..set(
leftEdge.vertex2, leftEdge.vertex2,
Vector2(-10.9, -50.5), Vector2(-11.1, -50.5),
); );
final rightEdge = EdgeShape() final rightEdge = EdgeShape()
..set( ..set(
topEdge.vertex2, topEdge.vertex2,
Vector2(-9.2, -47.1), Vector2(-9.4, -47.1),
); );
return [ return [
@ -67,7 +67,7 @@ class _ComputerBaseSpriteComponent extends SpriteComponent with HasGameRef {
_ComputerBaseSpriteComponent() _ComputerBaseSpriteComponent()
: super( : super(
anchor: Anchor.center, anchor: Anchor.center,
position: Vector2(-12.24, -48.15), position: Vector2(-12.44, -48.15),
); );
@override @override
@ -89,7 +89,7 @@ class _ComputerTopSpriteComponent extends SpriteComponent
_ComputerTopSpriteComponent() _ComputerTopSpriteComponent()
: super( : super(
anchor: Anchor.center, anchor: Anchor.center,
position: Vector2(-12.66, -49.37), position: Vector2(-12.86, -49.37),
) { ) {
zIndex = ZIndexes.computerTop; zIndex = ZIndexes.computerTop;
} }
@ -113,9 +113,9 @@ class _ComputerGlowSpriteComponent extends SpriteComponent
_ComputerGlowSpriteComponent() _ComputerGlowSpriteComponent()
: super( : super(
anchor: Anchor.center, anchor: Anchor.center,
position: Vector2(4.2, 11), position: Vector2(4, 11),
) { ) {
zIndex = ZIndexes.computerGlow + 4; zIndex = ZIndexes.computerGlow;
} }
@override @override

@ -77,7 +77,7 @@ abstract class ZIndexes {
static const computerTop = _above + ballOnBoard; static const computerTop = _above + ballOnBoard;
static const computerGlow = _above + ballOnBoard; static const computerGlow = _above + computerTop;
static const sparkyAnimatronic = _above + spaceshipRampForegroundRailing; static const sparkyAnimatronic = _above + spaceshipRampForegroundRailing;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 MiB

After

Width:  |  Height:  |  Size: 1.5 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 MiB

After

Width:  |  Height:  |  Size: 1.2 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 148 KiB

After

Width:  |  Height:  |  Size: 148 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 216 KiB

After

Width:  |  Height:  |  Size: 218 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 38 KiB

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 252 KiB

After

Width:  |  Height:  |  Size: 254 KiB

Loading…
Cancel
Save