From f747a12aaa596a6c1387a14c2e9fbc424919ff0c Mon Sep 17 00:00:00 2001 From: RuiAlonso Date: Wed, 23 Mar 2022 19:26:16 +0100 Subject: [PATCH] feat: removed required angle and added tests --- lib/game/components/pathway.dart | 1 - test/game/components/pathway_test.dart | 36 ++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/lib/game/components/pathway.dart b/lib/game/components/pathway.dart index 30595f02..0fb67f72 100644 --- a/lib/game/components/pathway.dart +++ b/lib/game/components/pathway.dart @@ -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, }) { diff --git a/test/game/components/pathway_test.dart b/test/game/components/pathway_test.dart index 03b67c62..bd2cdc8d 100644 --- a/test/game/components/pathway_test.dart +++ b/test/game/components/pathway_test.dart @@ -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),