diff --git a/packages/pinball_components/sandbox/lib/stories/flutter_forest/small_dash_nest_bumper_a_game.dart b/packages/pinball_components/sandbox/lib/stories/flutter_forest/small_dash_nest_bumper_a_game.dart new file mode 100644 index 00000000..a8499581 --- /dev/null +++ b/packages/pinball_components/sandbox/lib/stories/flutter_forest/small_dash_nest_bumper_a_game.dart @@ -0,0 +1,26 @@ +import 'dart:async'; +import 'dart:ui'; + +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 SmallDashNestBumperAGame extends BasicBallGame with Traceable { + SmallDashNestBumperAGame() : super(color: const Color(0xFF0000FF)); + + static const info = ''' + Shows how a SmallDashNestBumper ("a") is rendered. + + - Activate the "trace" parameter to overlay the body. +'''; + + @override + Future onLoad() async { + await super.onLoad(); + camera.followVector2(Vector2.zero()); + await add(SmallDashNestBumper.a()..priority = 1); + await traceAllBodies(); + await traceAllBodies(); + } +} diff --git a/packages/pinball_components/sandbox/lib/stories/flutter_forest/small_dash_nest_bumper_b_game.dart b/packages/pinball_components/sandbox/lib/stories/flutter_forest/small_dash_nest_bumper_b_game.dart new file mode 100644 index 00000000..91b2a383 --- /dev/null +++ b/packages/pinball_components/sandbox/lib/stories/flutter_forest/small_dash_nest_bumper_b_game.dart @@ -0,0 +1,26 @@ +import 'dart:async'; +import 'dart:ui'; + +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 SmallDashNestBumperBGame extends BasicBallGame with Traceable { + SmallDashNestBumperBGame() : super(color: const Color(0xFF0000FF)); + + static const info = ''' + Shows how a SmallDashNestBumper ("b") is rendered. + + - Activate the "trace" parameter to overlay the body. +'''; + + @override + Future onLoad() async { + await super.onLoad(); + camera.followVector2(Vector2.zero()); + await add(SmallDashNestBumper.b()..priority = 1); + await traceAllBodies(); + await traceAllBodies(); + } +} diff --git a/packages/pinball_components/sandbox/lib/stories/flutter_forest/stories.dart b/packages/pinball_components/sandbox/lib/stories/flutter_forest/stories.dart index 5b402038..895d11cd 100644 --- a/packages/pinball_components/sandbox/lib/stories/flutter_forest/stories.dart +++ b/packages/pinball_components/sandbox/lib/stories/flutter_forest/stories.dart @@ -4,9 +4,20 @@ import 'package:sandbox/common/common.dart'; import 'package:sandbox/stories/ball/basic_ball_game.dart'; import 'package:sandbox/stories/flutter_forest/big_dash_nest_bumper_game.dart'; import 'package:sandbox/stories/flutter_forest/flutter_sign_post_game.dart'; +import 'package:sandbox/stories/flutter_forest/small_dash_nest_bumper_a_game.dart'; +import 'package:sandbox/stories/flutter_forest/small_dash_nest_bumper_b_game.dart'; void addDashNestBumperStories(Dashbook dashbook) { dashbook.storiesOf('Flutter Forest') + ..add( + 'Flutter Sign Post', + (context) => GameWidget( + game: FlutterSignPostGame() + ..trace = context.boolProperty('Trace', true), + ), + codeLink: buildSourceLink('flutter_forest/flutter_sign_post.dart'), + info: FlutterSignPostGame.info, + ) ..add( 'Big Dash Nest Bumper', (context) => GameWidget( @@ -17,12 +28,21 @@ void addDashNestBumperStories(Dashbook dashbook) { info: BigDashNestBumperGame.info, ) ..add( - 'FLutter Sign Post', + 'Small Dash Nest Bumper A', (context) => GameWidget( - game: FlutterSignPostGame() + game: SmallDashNestBumperAGame() ..trace = context.boolProperty('Trace', true), ), - codeLink: buildSourceLink('flutter_forest/flutter_sign_post.dart'), - info: FlutterSignPostGame.info, + codeLink: buildSourceLink('flutter_forest/small_dash_nest_bumper_a.dart'), + info: SmallDashNestBumperAGame.info, + ) + ..add( + 'Small Dash Nest Bumper B', + (context) => GameWidget( + game: SmallDashNestBumperBGame() + ..trace = context.boolProperty('Trace', true), + ), + codeLink: buildSourceLink('flutter_forest/small_dash_nest_bumper_b.dart'), + info: SmallDashNestBumperBGame.info, ); }