mirror of https://github.com/flutter/pinball.git
parent
707e2e78b0
commit
b09a57541b
After Width: | Height: | Size: 35 KiB |
@ -0,0 +1,23 @@
|
|||||||
|
import 'package:flame/components.dart';
|
||||||
|
import 'package:pinball_components/pinball_components.dart';
|
||||||
|
import 'package:sandbox/common/common.dart';
|
||||||
|
|
||||||
|
class BackboardGameOverGame extends BasicGame {
|
||||||
|
static const info = '''
|
||||||
|
Simple example showing the waiting mode of the backboard.
|
||||||
|
''';
|
||||||
|
|
||||||
|
@override
|
||||||
|
Future<void> onLoad() async {
|
||||||
|
camera
|
||||||
|
..followVector2(Vector2.zero())
|
||||||
|
..zoom = 5;
|
||||||
|
|
||||||
|
await add(
|
||||||
|
Backboard(
|
||||||
|
position: Vector2(0, 20),
|
||||||
|
startsAtWaiting: false,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,25 @@
|
|||||||
|
import 'package:dashbook/dashbook.dart';
|
||||||
|
import 'package:flame/game.dart';
|
||||||
|
import 'package:sandbox/common/common.dart';
|
||||||
|
import 'package:sandbox/stories/backboard/game_over.dart';
|
||||||
|
import 'package:sandbox/stories/backboard/waiting.dart';
|
||||||
|
|
||||||
|
void addBackboardStories(Dashbook dashbook) {
|
||||||
|
dashbook.storiesOf('Backboard')
|
||||||
|
..add(
|
||||||
|
'Waiting mode',
|
||||||
|
(context) => GameWidget(
|
||||||
|
game: BackboardWaitingGame(),
|
||||||
|
),
|
||||||
|
codeLink: buildSourceLink('backboard/waiting.dart'),
|
||||||
|
info: BackboardWaitingGame.info,
|
||||||
|
)
|
||||||
|
..add(
|
||||||
|
'Game over',
|
||||||
|
(context) => GameWidget(
|
||||||
|
game: BackboardGameOverGame(),
|
||||||
|
),
|
||||||
|
codeLink: buildSourceLink('backboard/game_over.dart'),
|
||||||
|
info: BackboardGameOverGame.info,
|
||||||
|
);
|
||||||
|
}
|
@ -0,0 +1,19 @@
|
|||||||
|
import 'package:flame/components.dart';
|
||||||
|
import 'package:pinball_components/pinball_components.dart';
|
||||||
|
import 'package:sandbox/common/common.dart';
|
||||||
|
|
||||||
|
class BackboardWaitingGame extends BasicGame {
|
||||||
|
static const info = '''
|
||||||
|
Simple example showing the waiting mode of the backboard.
|
||||||
|
''';
|
||||||
|
|
||||||
|
@override
|
||||||
|
Future<void> onLoad() async {
|
||||||
|
camera
|
||||||
|
..followVector2(Vector2.zero())
|
||||||
|
..zoom = 5;
|
||||||
|
|
||||||
|
final backboard = Backboard(position: Vector2(0, 20));
|
||||||
|
await add(backboard);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in new issue