feat: added Traceable to ChromeDinoGame

pull/229/head
alestiago 3 years ago
parent 26e981f2ee
commit ec4e26fff7

@ -2,7 +2,7 @@ import 'package:flame_forge2d/flame_forge2d.dart';
import 'package:pinball_components/pinball_components.dart'; import 'package:pinball_components/pinball_components.dart';
import 'package:sandbox/common/common.dart'; import 'package:sandbox/common/common.dart';
class ChromeDinoGame extends BasicGame { class ChromeDinoGame extends BasicGame with Traceable {
static const info = 'Shows how a ChromeDino is rendered.'; static const info = 'Shows how a ChromeDino is rendered.';
@override @override
@ -11,5 +11,7 @@ class ChromeDinoGame extends BasicGame {
camera.followVector2(Vector2.zero()); camera.followVector2(Vector2.zero());
await add(ChromeDino()); await add(ChromeDino());
await traceAllBodies();
} }
} }

@ -7,7 +7,7 @@ void addChromeDinoStories(Dashbook dashbook) {
dashbook.storiesOf('Chrome Dino').add( dashbook.storiesOf('Chrome Dino').add(
'Basic', 'Basic',
(context) => GameWidget( (context) => GameWidget(
game: ChromeDinoGame(), game: ChromeDinoGame()..trace = context.boolProperty('Trace', true),
), ),
codeLink: buildSourceLink('chrome_dino/basic.dart'), codeLink: buildSourceLink('chrome_dino/basic.dart'),
info: ChromeDinoGame.info, info: ChromeDinoGame.info,

Loading…
Cancel
Save