feat: adjusted SlingShot size

pull/48/head
alestiago 4 years ago
parent d9289fdd32
commit ecf3b42a17

@ -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<FixtureDef> _createFixtureDefs() {
final fixtures = <FixtureDef>[];
// 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);

Loading…
Cancel
Save