feat: cow sanbox

pull/257/head
RuiAlonso 3 years ago
parent 263cdf4396
commit bf95b16772

@ -0,0 +1,34 @@
import 'dart:async';
import 'package:flame/extensions.dart';
import 'package:pinball_components/pinball_components.dart';
import 'package:sandbox/stories/ball/basic_ball_game.dart';
class AndroidBumperCowGame extends BallGame {
AndroidBumperCowGame()
: super(
color: const Color(0xFF0000FF),
imagesFileNames: [
Assets.images.androidBumper.cow.lit.keyName,
Assets.images.androidBumper.cow.dimmed.keyName,
],
);
static const description = '''
Shows how a AndroidBumperCowGame is rendered.
- Activate the "trace" parameter to overlay the body.
''';
@override
Future<void> onLoad() async {
await super.onLoad();
camera.followVector2(Vector2.zero());
await add(
AndroidBumper.cow()..priority = 1,
);
await traceAllBodies();
}
}

@ -2,6 +2,7 @@ import 'package:dashbook/dashbook.dart';
import 'package:sandbox/common/common.dart';
import 'package:sandbox/stories/android_acres/android_bumper_a_game.dart';
import 'package:sandbox/stories/android_acres/android_bumper_b_game.dart';
import 'package:sandbox/stories/android_acres/android_bumper_cow_game.dart';
import 'package:sandbox/stories/android_acres/spaceship_game.dart';
import 'package:sandbox/stories/android_acres/spaceship_rail_game.dart';
import 'package:sandbox/stories/android_acres/spaceship_ramp_game.dart';
@ -18,6 +19,11 @@ void addAndroidAcresStories(Dashbook dashbook) {
description: AndroidBumperBGame.description,
gameBuilder: (_) => AndroidBumperBGame(),
)
..addGame(
title: 'Android Bumper Cow',
description: AndroidBumperCowGame.description,
gameBuilder: (_) => AndroidBumperCowGame(),
)
..addGame(
title: 'Spaceship',
description: SpaceshipGame.description,

Loading…
Cancel
Save