mirror of https://github.com/flutter/pinball.git
refactor: bottom boundary curve (#156)
* refactor: update bottom curve * fix: unused import * fix: disable golden tests * refactor: use Traceable * chore: re-enable zoom golden testspull/171/head
parent
bfba65823f
commit
98f25242b6
Before Width: | Height: | Size: 150 KiB After Width: | Height: | Size: 18 KiB |
@ -0,0 +1,29 @@
|
||||
import 'package:flame/extensions.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 with Traceable {
|
||||
BoundariesGame() : super(color: const Color(0xFFFF0000));
|
||||
|
||||
static const info = '''
|
||||
Shows how Boundaries are rendered.
|
||||
|
||||
- Activate the "trace" parameter to overlay the body.
|
||||
- Tap anywhere on the screen to spawn a ball into the game.
|
||||
''';
|
||||
|
||||
@override
|
||||
Future<void> onLoad() async {
|
||||
await super.onLoad();
|
||||
|
||||
await addFromBlueprint(Boundaries());
|
||||
await ready();
|
||||
|
||||
camera
|
||||
..followVector2(Vector2.zero())
|
||||
..zoom = 6;
|
||||
|
||||
await traceAllBodies();
|
||||
}
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
import 'package:dashbook/dashbook.dart';
|
||||
import 'package:flame/game.dart';
|
||||
import 'package:sandbox/common/common.dart';
|
||||
import 'package:sandbox/stories/boundaries/boundaries_game.dart';
|
||||
|
||||
void addBoundariesStories(Dashbook dashbook) {
|
||||
dashbook.storiesOf('Boundaries').add(
|
||||
'Basic',
|
||||
(context) => GameWidget(
|
||||
game: BoundariesGame()..trace = context.boolProperty('Trace', true),
|
||||
),
|
||||
codeLink: buildSourceLink('boundaries_game/basic.dart'),
|
||||
info: BoundariesGame.info,
|
||||
);
|
||||
}
|
Before Width: | Height: | Size: 324 KiB After Width: | Height: | Size: 153 KiB |
Loading…
Reference in new issue