|
|
|
@ -1,13 +1,10 @@
|
|
|
|
|
import 'package:flame/extensions.dart';
|
|
|
|
|
import 'package:flame_forge2d/flame_forge2d.dart';
|
|
|
|
|
import 'package:pinball_components/pinball_components.dart';
|
|
|
|
|
import 'package:sandbox/common/common.dart';
|
|
|
|
|
import 'package:sandbox/stories/ball/basic_ball_game.dart';
|
|
|
|
|
|
|
|
|
|
class BoundariesGame extends BasicBallGame {
|
|
|
|
|
BoundariesGame({
|
|
|
|
|
required this.trace,
|
|
|
|
|
}) : super(color: const Color(0xFFFF0000));
|
|
|
|
|
class BoundariesGame extends BasicBallGame with Traceable {
|
|
|
|
|
BoundariesGame() : super(color: const Color(0xFFFF0000));
|
|
|
|
|
|
|
|
|
|
static const info = '''
|
|
|
|
|
Shows how Boundaries are rendered.
|
|
|
|
@ -16,8 +13,6 @@ class BoundariesGame extends BasicBallGame {
|
|
|
|
|
- Tap anywhere on the screen to spawn a ball into the game.
|
|
|
|
|
''';
|
|
|
|
|
|
|
|
|
|
final bool trace;
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Future<void> onLoad() async {
|
|
|
|
|
await super.onLoad();
|
|
|
|
@ -29,12 +24,6 @@ class BoundariesGame extends BasicBallGame {
|
|
|
|
|
..followVector2(Vector2.zero())
|
|
|
|
|
..zoom = 6;
|
|
|
|
|
|
|
|
|
|
final bottomBoundary = children.whereType<BodyComponent>().first;
|
|
|
|
|
final outerBoundary = children.whereType<BodyComponent>().last;
|
|
|
|
|
|
|
|
|
|
if (trace) {
|
|
|
|
|
bottomBoundary.trace();
|
|
|
|
|
outerBoundary.trace();
|
|
|
|
|
}
|
|
|
|
|
await traceAllBodies();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|