mirror of https://github.com/flutter/pinball.git
parent
2c425670f6
commit
92541eae5f
@ -0,0 +1,18 @@
|
|||||||
|
import 'package:flame_forge2d/flame_forge2d.dart';
|
||||||
|
import 'package:pinball_components/pinball_components.dart';
|
||||||
|
|
||||||
|
class ChromeDinoGame extends Forge2DGame {
|
||||||
|
static const info = '''
|
||||||
|
Shows how a ChromeDino is rendered.
|
||||||
|
''';
|
||||||
|
|
||||||
|
@override
|
||||||
|
Future<void> onLoad() async {
|
||||||
|
await super.onLoad();
|
||||||
|
|
||||||
|
final center = screenToWorld(camera.viewport.canvasSize! / 2);
|
||||||
|
await add(
|
||||||
|
ChromeDino()..initialPosition = center,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,15 @@
|
|||||||
|
import 'package:dashbook/dashbook.dart';
|
||||||
|
import 'package:flame/game.dart';
|
||||||
|
import 'package:sandbox/common/common.dart';
|
||||||
|
import 'package:sandbox/stories/chrome_dino/chrome_dino_game.dart';
|
||||||
|
|
||||||
|
void addChromeDinoStories(Dashbook dashbook) {
|
||||||
|
dashbook.storiesOf('Chrome Dino').add(
|
||||||
|
'Basic',
|
||||||
|
(context) => GameWidget(
|
||||||
|
game: ChromeDinoGame(),
|
||||||
|
),
|
||||||
|
codeLink: buildSourceLink('chrome_dino/basic.dart'),
|
||||||
|
info: ChromeDinoGame.info,
|
||||||
|
);
|
||||||
|
}
|
@ -1,5 +1,6 @@
|
|||||||
export 'ball/ball.dart';
|
export 'ball/ball.dart';
|
||||||
export 'baseboard/baseboard.dart';
|
export 'baseboard/baseboard.dart';
|
||||||
|
export 'chrome_dino/stories.dart';
|
||||||
export 'effects/effects.dart';
|
export 'effects/effects.dart';
|
||||||
export 'flipper/flipper.dart';
|
export 'flipper/flipper.dart';
|
||||||
export 'layer/layer.dart';
|
export 'layer/layer.dart';
|
||||||
|
Loading…
Reference in new issue