refactor: reposition

pull/155/head
Allison Ryan 4 years ago
parent a3d0bf0152
commit 3d6cd88f60

@ -18,7 +18,7 @@ class ControlledSparkyComputer extends SparkyComputer
void build(Forge2DGame _) { void build(Forge2DGame _) {
addContactCallback(_SparkyTurboChargeSensorBallContactCallback()); addContactCallback(_SparkyTurboChargeSensorBallContactCallback());
final sparkyTurboChargeSensor = _SparkyTurboChargeSensor() final sparkyTurboChargeSensor = _SparkyTurboChargeSensor()
..initialPosition = Vector2(-13.4, 49.8); ..initialPosition = Vector2(-13, 49.8);
add(sparkyTurboChargeSensor); add(sparkyTurboChargeSensor);
super.build(_); super.build(_);
} }
@ -47,7 +47,7 @@ class _SparkyTurboChargeSensor extends BodyComponent with InitialPosition {
/// Controller attached to a [SparkyComputer] that handles its game related /// Controller attached to a [SparkyComputer] that handles its game related
/// logic. /// logic.
/// {@endtemplate} /// {@endtemplate}
//TODO(allisonryan0002): listen for turbo charge game bonus and animate Sparky. // TODO(allisonryan0002): listen for turbo charge game bonus and animate Sparky.
class SparkyComputerController class SparkyComputerController
extends ComponentController<ControlledSparkyComputer> { extends ComponentController<ControlledSparkyComputer> {
/// {@macro sparky_computer_controller} /// {@macro sparky_computer_controller}

@ -148,7 +148,7 @@ class DebugPinballGame extends PinballGame with TapDetector {
@override @override
Future<void> onLoad() async { Future<void> onLoad() async {
await super.onLoad(); await super.onLoad();
// await _loadBackground(); await _loadBackground();
} }
// TODO(alestiago): Move to PinballGame once we have the real background // TODO(alestiago): Move to PinballGame once we have the real background

@ -66,7 +66,7 @@ class Ball<T extends Forge2DGame> extends BodyComponent<T>
/// ///
/// The [Ball] will no longer be affected by any forces, including it's /// The [Ball] will no longer be affected by any forces, including it's
/// weight and those emitted from collisions. /// weight and those emitted from collisions.
//TODO(allisonryan0002): prevent motion from contact with other balls. // TODO(allisonryan0002): prevent motion from contact with other balls.
void stop() { void stop() {
body body
..gravityScale = 0 ..gravityScale = 0

@ -28,24 +28,24 @@ class _ComputerBase extends BodyComponent with InitialPosition {
final leftEdge = EdgeShape() final leftEdge = EdgeShape()
..set( ..set(
Vector2(-15.3, 46), Vector2(-14.9, 46),
Vector2(-15.7, 49.6), Vector2(-15.3, 49.6),
); );
final leftEdgeFixtureDef = FixtureDef(leftEdge); final leftEdgeFixtureDef = FixtureDef(leftEdge);
fixturesDef.add(leftEdgeFixtureDef); fixturesDef.add(leftEdgeFixtureDef);
final topEdge = EdgeShape() final topEdge = EdgeShape()
..set( ..set(
Vector2(-15.7, 49.6), Vector2(-15.3, 49.6),
Vector2(-11.1, 50.6), Vector2(-10.7, 50.6),
); );
final topEdgeFixtureDef = FixtureDef(topEdge); final topEdgeFixtureDef = FixtureDef(topEdge);
fixturesDef.add(topEdgeFixtureDef); fixturesDef.add(topEdgeFixtureDef);
final rightEdge = EdgeShape() final rightEdge = EdgeShape()
..set( ..set(
Vector2(-11.1, 50.6), Vector2(-10.7, 50.6),
Vector2(-9.4, 47.2), Vector2(-9, 47.2),
); );
final rightEdgeFixtureDef = FixtureDef(rightEdge); final rightEdgeFixtureDef = FixtureDef(rightEdge);
fixturesDef.add(rightEdgeFixtureDef); fixturesDef.add(rightEdgeFixtureDef);
@ -82,7 +82,7 @@ class _ComputerBase extends BodyComponent with InitialPosition {
sprite: sprite, sprite: sprite,
size: sprite.originalSize / 10, size: sprite.originalSize / 10,
anchor: Anchor.center, anchor: Anchor.center,
position: Vector2(-12.35, -48.35), position: Vector2(-11.95, -48.35),
), ),
); );
} }
@ -92,7 +92,7 @@ class _ComputerTop extends SpriteComponent with HasGameRef {
_ComputerTop() _ComputerTop()
: super( : super(
anchor: Anchor.center, anchor: Anchor.center,
position: Vector2(-12.85, -49.75), position: Vector2(-12.45, -49.75),
priority: 1, priority: 1,
); );

Loading…
Cancel
Save