mirror of https://github.com/flutter/pinball.git
parent
b3678d8933
commit
4f6c8be551
@ -0,0 +1,31 @@
|
|||||||
|
import 'dart:async';
|
||||||
|
|
||||||
|
import 'package:flame/input.dart';
|
||||||
|
import 'package:pinball_components/pinball_components.dart';
|
||||||
|
import 'package:pinball_flame/pinball_flame.dart';
|
||||||
|
import 'package:sandbox/stories/ball/basic_ball_game.dart';
|
||||||
|
|
||||||
|
class DinoWallGame extends BasicBallGame {
|
||||||
|
DinoWallGame() : super();
|
||||||
|
|
||||||
|
static const info = '''
|
||||||
|
Shows how DinoWalls 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 images.loadAll([
|
||||||
|
Assets.images.dino.dinoLandTop.keyName,
|
||||||
|
Assets.images.dino.dinoLandBottom.keyName,
|
||||||
|
]);
|
||||||
|
|
||||||
|
await addFromBlueprint(DinoWalls());
|
||||||
|
camera.followVector2(Vector2.zero());
|
||||||
|
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/dino_wall/dino_wall_game.dart';
|
||||||
|
|
||||||
|
void addDinoWallStories(Dashbook dashbook) {
|
||||||
|
dashbook.storiesOf('DinoWall').add(
|
||||||
|
'Basic',
|
||||||
|
(context) => GameWidget(
|
||||||
|
game: DinoWallGame()..trace = context.boolProperty('Trace', true),
|
||||||
|
),
|
||||||
|
codeLink: buildSourceLink('dino_wall/basic.dart'),
|
||||||
|
info: DinoWallGame.info,
|
||||||
|
);
|
||||||
|
}
|
Loading…
Reference in new issue