fix: add bumper noise to cow bumper (#415)

pull/417/head
Allison Ryan 2 years ago committed by GitHub
parent d088a6ce11
commit cc73a52428
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -47,6 +47,7 @@ class AndroidAcres extends Component {
AndroidBumper.cow(
children: [
ScoringContactBehavior(points: Points.twentyThousand),
BumperNoiseBehavior(),
CowBumperNoiseBehavior(),
],
)..initialPosition = Vector2(-20.7, -13),

@ -117,18 +117,16 @@ void main() {
);
flameTester.test(
'two AndroidBumpers with BumperNoiseBehavior',
'three AndroidBumpers with BumperNoiseBehavior',
(game) async {
await game.pump(AndroidAcres());
final bumpers = game.descendants().whereType<AndroidBumper>();
var behaviorCount = 0;
for (final bumper in bumpers) {
if (bumper.firstChild<BumperNoiseBehavior>() != null) {
behaviorCount++;
}
expect(
bumper.firstChild<BumperNoiseBehavior>(),
isA<BumperNoiseBehavior>(),
);
}
expect(behaviorCount, equals(2));
},
);

Loading…
Cancel
Save