feat: removed required angle and added tests

pull/84/head
RuiAlonso 4 years ago
parent 45cede6783
commit f747a12aaa

@ -156,7 +156,6 @@ class Pathway extends BodyComponent with InitialPosition, Layered {
required double width,
required double bigRadius,
required double smallRadius,
required double angle,
double rotation = 0,
bool singleWall = false,
}) {

@ -165,6 +165,42 @@ void main() {
});
});
group('ellipse', () {
flameTester.test(
'loads correctly',
(game) async {
final pathway = Pathway.ellipse(
center: Vector2.zero(),
width: width,
bigRadius: 150,
smallRadius: 70,
);
await game.ready();
await game.ensureAdd(pathway);
expect(game.contains(pathway), isTrue);
},
);
group('body', () {
flameTester.test(
'is static',
(game) async {
final pathway = Pathway.ellipse(
center: Vector2.zero(),
width: width,
bigRadius: 150,
smallRadius: 70,
);
await game.ready();
await game.ensureAdd(pathway);
expect(pathway.body.bodyType, equals(BodyType.static));
},
);
});
});
group('bezier curve', () {
final controlPoints = [
Vector2(0, 0),

Loading…
Cancel
Save