refactor: add Traceable

pull/152/head
RuiAlonso 4 years ago
parent 00f717bf7a
commit b70d0e1229

@ -15,7 +15,9 @@ class Plunger extends BodyComponent with KeyboardHandler, InitialPosition {
required this.compressionDistance, required this.compressionDistance,
// TODO(ruimiguel): set to priority +1 over LaunchRamp once all priorities // TODO(ruimiguel): set to priority +1 over LaunchRamp once all priorities
// are fixed. // are fixed.
}) : super(priority: 0); }) : super(priority: 0) {
renderBody = false;
}
/// Distance the plunger can lower. /// Distance the plunger can lower.
final double compressionDistance; final double compressionDistance;
@ -96,9 +98,6 @@ class Plunger extends BodyComponent with KeyboardHandler, InitialPosition {
Future<void> onLoad() async { Future<void> onLoad() async {
await super.onLoad(); await super.onLoad();
await _anchorToJoint(); await _anchorToJoint();
renderBody = false;
await _loadSprite(); await _loadSprite();
} }
@ -135,12 +134,8 @@ class PlungerAnchor extends JointAnchor {
@override @override
Body createBody() { Body createBody() {
final shape = CircleShape()..radius = 0.5; final bodyDef = BodyDef()..position = initialPosition;
final fixtureDef = FixtureDef(shape); return world.createBody(bodyDef);
final bodyDef = BodyDef()
..position = initialPosition
..type = BodyType.static;
return world.createBody(bodyDef)..createFixture(fixtureDef);
} }
} }

Loading…
Cancel
Save