diff --git a/lib/game/components/sling_shot.dart b/lib/game/components/sling_shot.dart index dacf1ee5..0791cf4f 100644 --- a/lib/game/components/sling_shot.dart +++ b/lib/game/components/sling_shot.dart @@ -33,18 +33,19 @@ class SlingShot extends BodyComponent { /// left. final BoardSide _side; + /// The size of the [SlingShot] body. + // TODO(alestiago): Use size from PositionedBodyComponent instead, + // once a sprite is given. + static final Vector2 size = Vector2(6, 8); + List _createFixtureDefs() { final fixtures = []; - // TODO(alestiago): Use size from PositionedBodyComponent instead, - // once a sprite is given. - final size = Vector2(10, 10); - // TODO(alestiago): This magic number can be deduced by specifying the // angle and using polar coordinate system to place the bottom right // vertex. // Something as: y = -size.y * math.cos(angle) - const additionalIncrement = 2; + const additionalIncrement = 3; final triangleVertices = _side.isLeft ? [ Vector2(0, 0), @@ -78,7 +79,7 @@ class SlingShot extends BodyComponent { ); // TODO(alestiago): Play with restitution value once game is bundled. final kickerFixtureDef = FixtureDef(kicker) - ..restitution = 20.0 + ..restitution = 10.0 ..friction = 0; fixtures.add(kickerFixtureDef);