mirror of https://github.com/flutter/pinball.git
feat: implemented `AndroidBumper.cow` (#257)
* feat: added cow assets * feat: added cow bumper * feat: cow sanbox * Update packages/pinball_components/sandbox/lib/stories/android_acres/android_bumper_cow_game.dart Co-authored-by: Alejandro Santiago <dev@alestiago.com> * refactor: sandbox ball color * fix: cow bumper spriteposition * fix: cow bumper size * refactor: cow shape and positioning Co-authored-by: Alejandro Santiago <dev@alestiago.com> Co-authored-by: Allison Ryan <allisonryan0002@gmail.com> Co-authored-by: Allison Ryan <77211884+allisonryan0002@users.noreply.github.com>pull/269/head
parent
fc039ec082
commit
7d8cd8c357
After Width: | Height: | Size: 10 KiB |
After Width: | Height: | Size: 10 KiB |
@ -0,0 +1,33 @@
|
|||||||
|
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(
|
||||||
|
imagesFileNames: [
|
||||||
|
Assets.images.androidBumper.cow.lit.keyName,
|
||||||
|
Assets.images.androidBumper.cow.dimmed.keyName,
|
||||||
|
],
|
||||||
|
);
|
||||||
|
|
||||||
|
static const description = '''
|
||||||
|
Shows how a AndroidBumper.cow 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();
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in new issue