feat(sandbox): included SmallDashNestBumper

pull/167/head
alestiago 4 years ago
parent b317a1932e
commit fdf0551179

@ -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<void> onLoad() async {
await super.onLoad();
camera.followVector2(Vector2.zero());
await add(SmallDashNestBumper.a()..priority = 1);
await traceAllBodies();
await traceAllBodies();
}
}

@ -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<void> onLoad() async {
await super.onLoad();
camera.followVector2(Vector2.zero());
await add(SmallDashNestBumper.b()..priority = 1);
await traceAllBodies();
await traceAllBodies();
}
}

@ -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,
);
}

Loading…
Cancel
Save