refactor: `SparkyScorch` and asset renaming (#268)
* refactor: sparky scorch * test: update golden * chore: update preLoad method * chore: remove constructorpull/278/head
Before Width: | Height: | Size: 7.0 KiB After Width: | Height: | Size: 7.0 KiB |
Before Width: | Height: | Size: 7.2 KiB After Width: | Height: | Size: 7.2 KiB |
Before Width: | Height: | Size: 6.1 KiB After Width: | Height: | Size: 6.1 KiB |
Before Width: | Height: | Size: 6.3 KiB After Width: | Height: | Size: 6.3 KiB |
Before Width: | Height: | Size: 6.5 KiB After Width: | Height: | Size: 6.5 KiB |
Before Width: | Height: | Size: 6.6 KiB After Width: | Height: | Size: 6.6 KiB |
After Width: | Height: | Size: 156 KiB |
@ -1,10 +1,8 @@
|
|||||||
|
// ignore_for_file: public_member_api_docs
|
||||||
|
|
||||||
part of 'sparky_bumper_cubit.dart';
|
part of 'sparky_bumper_cubit.dart';
|
||||||
|
|
||||||
/// Indicates the [SparkyBumperCubit]'s current state.
|
|
||||||
enum SparkyBumperState {
|
enum SparkyBumperState {
|
||||||
/// A lit up bumper.
|
lit,
|
||||||
active,
|
dimmed,
|
||||||
|
|
||||||
/// A dimmed bumper.
|
|
||||||
inactive,
|
|
||||||
}
|
}
|
||||||
|
@ -1,11 +0,0 @@
|
|||||||
import 'package:dashbook/dashbook.dart';
|
|
||||||
import 'package:sandbox/common/common.dart';
|
|
||||||
import 'package:sandbox/stories/sparky_bumper/sparky_bumper_game.dart';
|
|
||||||
|
|
||||||
void addSparkyBumperStories(Dashbook dashbook) {
|
|
||||||
dashbook.storiesOf('Sparky Bumpers').addGame(
|
|
||||||
title: 'Traced',
|
|
||||||
description: SparkyBumperGame.description,
|
|
||||||
gameBuilder: (_) => SparkyBumperGame(),
|
|
||||||
);
|
|
||||||
}
|
|
@ -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 SparkyComputerGame extends BallGame {
|
||||||
|
static const description = '''
|
||||||
|
Shows how the SparkyComputer is 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.sparky.computer.base.keyName,
|
||||||
|
Assets.images.sparky.computer.top.keyName,
|
||||||
|
Assets.images.sparky.computer.glow.keyName,
|
||||||
|
]);
|
||||||
|
|
||||||
|
camera.followVector2(Vector2(-10, -40));
|
||||||
|
await addFromBlueprint(SparkyComputer());
|
||||||
|
await ready();
|
||||||
|
await traceAllBodies();
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,18 @@
|
|||||||
|
import 'package:dashbook/dashbook.dart';
|
||||||
|
import 'package:sandbox/common/common.dart';
|
||||||
|
import 'package:sandbox/stories/sparky_scorch/sparky_bumper_game.dart';
|
||||||
|
import 'package:sandbox/stories/sparky_scorch/sparky_computer_game.dart';
|
||||||
|
|
||||||
|
void addSparkyScorchStories(Dashbook dashbook) {
|
||||||
|
dashbook.storiesOf('Sparky Scorch')
|
||||||
|
..addGame(
|
||||||
|
title: 'Sparky Computer',
|
||||||
|
description: SparkyComputerGame.description,
|
||||||
|
gameBuilder: (_) => SparkyComputerGame(),
|
||||||
|
)
|
||||||
|
..addGame(
|
||||||
|
title: 'Sparky Bumper',
|
||||||
|
description: SparkyBumperGame.description,
|
||||||
|
gameBuilder: (_) => SparkyBumperGame(),
|
||||||
|
);
|
||||||
|
}
|
Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 209 KiB |