|
|
|
@ -20,11 +20,10 @@ void main() {
|
|
|
|
|
(game) async {
|
|
|
|
|
await game.ready();
|
|
|
|
|
final pathway = Pathway.straight(
|
|
|
|
|
position: Vector2.zero(),
|
|
|
|
|
start: Vector2(10, 10),
|
|
|
|
|
end: Vector2(20, 20),
|
|
|
|
|
width: width,
|
|
|
|
|
);
|
|
|
|
|
)..initialPosition = Vector2.zero();
|
|
|
|
|
await game.ensureAdd(pathway);
|
|
|
|
|
|
|
|
|
|
expect(game.contains(pathway), isTrue);
|
|
|
|
@ -44,11 +43,10 @@ void main() {
|
|
|
|
|
|
|
|
|
|
final pathway = Pathway.straight(
|
|
|
|
|
color: defaultColor,
|
|
|
|
|
position: Vector2.zero(),
|
|
|
|
|
start: Vector2(10, 10),
|
|
|
|
|
end: Vector2(20, 20),
|
|
|
|
|
width: width,
|
|
|
|
|
);
|
|
|
|
|
)..initialPosition = Vector2.zero();
|
|
|
|
|
await game.ensureAdd(pathway);
|
|
|
|
|
|
|
|
|
|
expect(game.contains(pathway), isTrue);
|
|
|
|
@ -63,11 +61,10 @@ void main() {
|
|
|
|
|
(game) async {
|
|
|
|
|
await game.ready();
|
|
|
|
|
final pathway = Pathway.straight(
|
|
|
|
|
position: Vector2.zero(),
|
|
|
|
|
start: Vector2(10, 10),
|
|
|
|
|
end: Vector2(20, 20),
|
|
|
|
|
width: width,
|
|
|
|
|
);
|
|
|
|
|
)..initialPosition = Vector2.zero();
|
|
|
|
|
await game.ensureAdd(pathway);
|
|
|
|
|
|
|
|
|
|
expect(game.contains(pathway), isTrue);
|
|
|
|
@ -81,15 +78,14 @@ void main() {
|
|
|
|
|
await game.ready();
|
|
|
|
|
final position = Vector2.all(10);
|
|
|
|
|
final pathway = Pathway.straight(
|
|
|
|
|
position: position,
|
|
|
|
|
start: Vector2(10, 10),
|
|
|
|
|
end: Vector2(20, 20),
|
|
|
|
|
width: width,
|
|
|
|
|
);
|
|
|
|
|
)..initialPosition = position;
|
|
|
|
|
await game.ensureAdd(pathway);
|
|
|
|
|
|
|
|
|
|
game.contains(pathway);
|
|
|
|
|
expect(pathway.body.position, position);
|
|
|
|
|
expect(pathway.body.position, equals(position));
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
@ -98,11 +94,10 @@ void main() {
|
|
|
|
|
(game) async {
|
|
|
|
|
await game.ready();
|
|
|
|
|
final pathway = Pathway.straight(
|
|
|
|
|
position: Vector2.zero(),
|
|
|
|
|
start: Vector2(10, 10),
|
|
|
|
|
end: Vector2(20, 20),
|
|
|
|
|
width: width,
|
|
|
|
|
);
|
|
|
|
|
)..initialPosition = Vector2.zero();
|
|
|
|
|
await game.ensureAdd(pathway);
|
|
|
|
|
|
|
|
|
|
expect(pathway.body.bodyType, equals(BodyType.static));
|
|
|
|
@ -116,12 +111,11 @@ void main() {
|
|
|
|
|
(game) async {
|
|
|
|
|
await game.ready();
|
|
|
|
|
final pathway = Pathway.straight(
|
|
|
|
|
position: Vector2.zero(),
|
|
|
|
|
start: Vector2(10, 10),
|
|
|
|
|
end: Vector2(20, 20),
|
|
|
|
|
width: width,
|
|
|
|
|
singleWall: true,
|
|
|
|
|
);
|
|
|
|
|
)..initialPosition = Vector2.zero();
|
|
|
|
|
await game.ensureAdd(pathway);
|
|
|
|
|
|
|
|
|
|
expect(pathway.body.fixtures.length, 1);
|
|
|
|
@ -136,11 +130,10 @@ void main() {
|
|
|
|
|
(game) async {
|
|
|
|
|
await game.ready();
|
|
|
|
|
final pathway = Pathway.straight(
|
|
|
|
|
position: Vector2.zero(),
|
|
|
|
|
start: Vector2(10, 10),
|
|
|
|
|
end: Vector2(20, 20),
|
|
|
|
|
width: width,
|
|
|
|
|
);
|
|
|
|
|
)..initialPosition = Vector2.zero();
|
|
|
|
|
await game.ensureAdd(pathway);
|
|
|
|
|
|
|
|
|
|
expect(pathway.body.fixtures.length, 2);
|
|
|
|
@ -159,11 +152,11 @@ void main() {
|
|
|
|
|
(game) async {
|
|
|
|
|
await game.ready();
|
|
|
|
|
final pathway = Pathway.arc(
|
|
|
|
|
position: Vector2.zero(),
|
|
|
|
|
center: Vector2.zero(),
|
|
|
|
|
width: width,
|
|
|
|
|
radius: 100,
|
|
|
|
|
angle: math.pi / 2,
|
|
|
|
|
);
|
|
|
|
|
)..initialPosition = Vector2.zero();
|
|
|
|
|
await game.ensureAdd(pathway);
|
|
|
|
|
|
|
|
|
|
expect(game.contains(pathway), isTrue);
|
|
|
|
@ -177,11 +170,11 @@ void main() {
|
|
|
|
|
await game.ready();
|
|
|
|
|
final position = Vector2.all(10);
|
|
|
|
|
final pathway = Pathway.arc(
|
|
|
|
|
position: position,
|
|
|
|
|
center: position,
|
|
|
|
|
width: width,
|
|
|
|
|
radius: 100,
|
|
|
|
|
angle: math.pi / 2,
|
|
|
|
|
);
|
|
|
|
|
)..initialPosition = position;
|
|
|
|
|
await game.ensureAdd(pathway);
|
|
|
|
|
|
|
|
|
|
game.contains(pathway);
|
|
|
|
@ -194,11 +187,11 @@ void main() {
|
|
|
|
|
(game) async {
|
|
|
|
|
await game.ready();
|
|
|
|
|
final pathway = Pathway.arc(
|
|
|
|
|
position: Vector2.zero(),
|
|
|
|
|
center: Vector2.zero(),
|
|
|
|
|
width: width,
|
|
|
|
|
radius: 100,
|
|
|
|
|
angle: math.pi / 2,
|
|
|
|
|
);
|
|
|
|
|
)..initialPosition = Vector2.zero();
|
|
|
|
|
await game.ensureAdd(pathway);
|
|
|
|
|
|
|
|
|
|
expect(pathway.body.bodyType, equals(BodyType.static));
|
|
|
|
@ -220,10 +213,9 @@ void main() {
|
|
|
|
|
(game) async {
|
|
|
|
|
await game.ready();
|
|
|
|
|
final pathway = Pathway.bezierCurve(
|
|
|
|
|
position: Vector2.zero(),
|
|
|
|
|
controlPoints: controlPoints,
|
|
|
|
|
width: width,
|
|
|
|
|
);
|
|
|
|
|
)..initialPosition = Vector2.zero();
|
|
|
|
|
await game.ensureAdd(pathway);
|
|
|
|
|
|
|
|
|
|
expect(game.contains(pathway), isTrue);
|
|
|
|
@ -237,10 +229,9 @@ void main() {
|
|
|
|
|
await game.ready();
|
|
|
|
|
final position = Vector2.all(10);
|
|
|
|
|
final pathway = Pathway.bezierCurve(
|
|
|
|
|
position: position,
|
|
|
|
|
controlPoints: controlPoints,
|
|
|
|
|
width: width,
|
|
|
|
|
);
|
|
|
|
|
)..initialPosition = position;
|
|
|
|
|
await game.ensureAdd(pathway);
|
|
|
|
|
|
|
|
|
|
game.contains(pathway);
|
|
|
|
@ -253,10 +244,9 @@ void main() {
|
|
|
|
|
(game) async {
|
|
|
|
|
await game.ready();
|
|
|
|
|
final pathway = Pathway.bezierCurve(
|
|
|
|
|
position: Vector2.zero(),
|
|
|
|
|
controlPoints: controlPoints,
|
|
|
|
|
width: width,
|
|
|
|
|
);
|
|
|
|
|
)..initialPosition = Vector2.zero();
|
|
|
|
|
await game.ensureAdd(pathway);
|
|
|
|
|
|
|
|
|
|
expect(pathway.body.bodyType, equals(BodyType.static));
|
|
|
|
|