|
|
@ -18,10 +18,9 @@ void main() {
|
|
|
|
(game) async {
|
|
|
|
(game) async {
|
|
|
|
await game.ready();
|
|
|
|
await game.ready();
|
|
|
|
final roundBumper = RoundBumper(
|
|
|
|
final roundBumper = RoundBumper(
|
|
|
|
position: Vector2.zero(),
|
|
|
|
|
|
|
|
radius: radius,
|
|
|
|
radius: radius,
|
|
|
|
points: points,
|
|
|
|
points: points,
|
|
|
|
);
|
|
|
|
)..initialPosition = Vector2.zero();
|
|
|
|
await game.ensureAdd(roundBumper);
|
|
|
|
await game.ensureAdd(roundBumper);
|
|
|
|
|
|
|
|
|
|
|
|
expect(game.contains(roundBumper), isTrue);
|
|
|
|
expect(game.contains(roundBumper), isTrue);
|
|
|
@ -32,10 +31,9 @@ void main() {
|
|
|
|
'has points',
|
|
|
|
'has points',
|
|
|
|
(game) async {
|
|
|
|
(game) async {
|
|
|
|
final roundBumper = RoundBumper(
|
|
|
|
final roundBumper = RoundBumper(
|
|
|
|
position: Vector2.zero(),
|
|
|
|
|
|
|
|
radius: radius,
|
|
|
|
radius: radius,
|
|
|
|
points: points,
|
|
|
|
points: points,
|
|
|
|
);
|
|
|
|
)..initialPosition = Vector2.zero();
|
|
|
|
await game.ensureAdd(roundBumper);
|
|
|
|
await game.ensureAdd(roundBumper);
|
|
|
|
|
|
|
|
|
|
|
|
expect(roundBumper.points, equals(points));
|
|
|
|
expect(roundBumper.points, equals(points));
|
|
|
@ -48,10 +46,9 @@ void main() {
|
|
|
|
(game) async {
|
|
|
|
(game) async {
|
|
|
|
final position = Vector2.all(10);
|
|
|
|
final position = Vector2.all(10);
|
|
|
|
final roundBumper = RoundBumper(
|
|
|
|
final roundBumper = RoundBumper(
|
|
|
|
position: position,
|
|
|
|
|
|
|
|
radius: radius,
|
|
|
|
radius: radius,
|
|
|
|
points: points,
|
|
|
|
points: points,
|
|
|
|
);
|
|
|
|
)..initialPosition = position;
|
|
|
|
await game.ensureAdd(roundBumper);
|
|
|
|
await game.ensureAdd(roundBumper);
|
|
|
|
game.contains(roundBumper);
|
|
|
|
game.contains(roundBumper);
|
|
|
|
|
|
|
|
|
|
|
@ -63,10 +60,9 @@ void main() {
|
|
|
|
'is static',
|
|
|
|
'is static',
|
|
|
|
(game) async {
|
|
|
|
(game) async {
|
|
|
|
final roundBumper = RoundBumper(
|
|
|
|
final roundBumper = RoundBumper(
|
|
|
|
position: Vector2.zero(),
|
|
|
|
|
|
|
|
radius: radius,
|
|
|
|
radius: radius,
|
|
|
|
points: points,
|
|
|
|
points: points,
|
|
|
|
);
|
|
|
|
)..initialPosition = Vector2.zero();
|
|
|
|
await game.ensureAdd(roundBumper);
|
|
|
|
await game.ensureAdd(roundBumper);
|
|
|
|
|
|
|
|
|
|
|
|
expect(roundBumper.body.bodyType, equals(BodyType.static));
|
|
|
|
expect(roundBumper.body.bodyType, equals(BodyType.static));
|
|
|
@ -79,10 +75,9 @@ void main() {
|
|
|
|
'exists',
|
|
|
|
'exists',
|
|
|
|
(game) async {
|
|
|
|
(game) async {
|
|
|
|
final roundBumper = RoundBumper(
|
|
|
|
final roundBumper = RoundBumper(
|
|
|
|
position: Vector2.zero(),
|
|
|
|
|
|
|
|
radius: radius,
|
|
|
|
radius: radius,
|
|
|
|
points: points,
|
|
|
|
points: points,
|
|
|
|
);
|
|
|
|
)..initialPosition = Vector2.zero();
|
|
|
|
await game.ensureAdd(roundBumper);
|
|
|
|
await game.ensureAdd(roundBumper);
|
|
|
|
|
|
|
|
|
|
|
|
expect(roundBumper.body.fixtures[0], isA<Fixture>());
|
|
|
|
expect(roundBumper.body.fixtures[0], isA<Fixture>());
|
|
|
@ -93,10 +88,9 @@ void main() {
|
|
|
|
'has restitution',
|
|
|
|
'has restitution',
|
|
|
|
(game) async {
|
|
|
|
(game) async {
|
|
|
|
final roundBumper = RoundBumper(
|
|
|
|
final roundBumper = RoundBumper(
|
|
|
|
position: Vector2.zero(),
|
|
|
|
|
|
|
|
radius: radius,
|
|
|
|
radius: radius,
|
|
|
|
points: points,
|
|
|
|
points: points,
|
|
|
|
);
|
|
|
|
)..initialPosition = Vector2.zero();
|
|
|
|
await game.ensureAdd(roundBumper);
|
|
|
|
await game.ensureAdd(roundBumper);
|
|
|
|
|
|
|
|
|
|
|
|
final fixture = roundBumper.body.fixtures[0];
|
|
|
|
final fixture = roundBumper.body.fixtures[0];
|
|
|
@ -108,10 +102,9 @@ void main() {
|
|
|
|
'shape is circular',
|
|
|
|
'shape is circular',
|
|
|
|
(game) async {
|
|
|
|
(game) async {
|
|
|
|
final roundBumper = RoundBumper(
|
|
|
|
final roundBumper = RoundBumper(
|
|
|
|
position: Vector2.zero(),
|
|
|
|
|
|
|
|
radius: radius,
|
|
|
|
radius: radius,
|
|
|
|
points: points,
|
|
|
|
points: points,
|
|
|
|
);
|
|
|
|
)..initialPosition = Vector2.zero();
|
|
|
|
await game.ensureAdd(roundBumper);
|
|
|
|
await game.ensureAdd(roundBumper);
|
|
|
|
|
|
|
|
|
|
|
|
final fixture = roundBumper.body.fixtures[0];
|
|
|
|
final fixture = roundBumper.body.fixtures[0];
|
|
|
|