mirror of https://github.com/flutter/pinball.git
parent
074f9a2cab
commit
ad8276bfc1
@ -1,7 +0,0 @@
|
|||||||
import 'package:flame_forge2d/flame_forge2d.dart';
|
|
||||||
import 'package:mocktail/mocktail.dart';
|
|
||||||
import 'package:pinball/game/game.dart';
|
|
||||||
|
|
||||||
class FakeContact extends Fake implements Contact {}
|
|
||||||
|
|
||||||
class FakeGameEvent extends Fake implements GameEvent {}
|
|
@ -1,13 +0,0 @@
|
|||||||
import 'package:flame_forge2d/flame_forge2d.dart';
|
|
||||||
|
|
||||||
void beginContact(Forge2DGame game, BodyComponent bodyA, BodyComponent bodyB) {
|
|
||||||
assert(
|
|
||||||
bodyA.body.fixtures.isNotEmpty && bodyB.body.fixtures.isNotEmpty,
|
|
||||||
'Bodies require fixtures to contact each other.',
|
|
||||||
);
|
|
||||||
|
|
||||||
final fixtureA = bodyA.body.fixtures.first;
|
|
||||||
final fixtureB = bodyB.body.fixtures.first;
|
|
||||||
final contact = Contact.init(fixtureA, 0, fixtureB, 0);
|
|
||||||
game.world.contactManager.contactListener?.beginContact(contact);
|
|
||||||
}
|
|
Loading…
Reference in new issue