|
|
@ -37,8 +37,7 @@ class FlutterForest extends Component with Controls<_FlutterForestController> {
|
|
|
|
final smallRightNest = _ControlledSmallDashNestBumper.b(
|
|
|
|
final smallRightNest = _ControlledSmallDashNestBumper.b(
|
|
|
|
id: 'small_nest_bumper_b',
|
|
|
|
id: 'small_nest_bumper_b',
|
|
|
|
)..initialPosition = Vector2(23.3, 46.75);
|
|
|
|
)..initialPosition = Vector2(23.3, 46.75);
|
|
|
|
final dashAnimatronic = _ControlledDashAnimatronic()
|
|
|
|
final dashAnimatronic = DashAnimatronic()..position = Vector2(20, -66);
|
|
|
|
..position = Vector2(20, -66);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await addAll([
|
|
|
|
await addAll([
|
|
|
|
signPost,
|
|
|
|
signPost,
|
|
|
@ -71,14 +70,10 @@ class _FlutterForestController extends ComponentController<FlutterForest>
|
|
|
|
void onNewState(GameState state) {
|
|
|
|
void onNewState(GameState state) {
|
|
|
|
super.onNewState(state);
|
|
|
|
super.onNewState(state);
|
|
|
|
|
|
|
|
|
|
|
|
_startDashAnimatronic();
|
|
|
|
component.firstChild<DashAnimatronic>()?.playing = true;
|
|
|
|
_addBonusBall();
|
|
|
|
_addBonusBall();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void _startDashAnimatronic() {
|
|
|
|
|
|
|
|
component.firstChild<_ControlledDashAnimatronic>()?.controller.start();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Future<void> _addBonusBall() async {
|
|
|
|
Future<void> _addBonusBall() async {
|
|
|
|
await Future<void>.delayed(const Duration(milliseconds: 700));
|
|
|
|
await Future<void>.delayed(const Duration(milliseconds: 700));
|
|
|
|
await gameRef.add(
|
|
|
|
await gameRef.add(
|
|
|
@ -88,23 +83,6 @@ class _FlutterForestController extends ComponentController<FlutterForest>
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
class _ControlledDashAnimatronic extends DashAnimatronic
|
|
|
|
|
|
|
|
with Controls<_DashAnimatronicController> {
|
|
|
|
|
|
|
|
_ControlledDashAnimatronic() {
|
|
|
|
|
|
|
|
controller = _DashAnimatronicController(this);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class _DashAnimatronicController extends ComponentController<DashAnimatronic>
|
|
|
|
|
|
|
|
with HasGameRef<PinballGame> {
|
|
|
|
|
|
|
|
_DashAnimatronicController(DashAnimatronic dashAnimatronic)
|
|
|
|
|
|
|
|
: super(dashAnimatronic);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void start() {
|
|
|
|
|
|
|
|
component.playing = true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class _ControlledBigDashNestBumper extends BigDashNestBumper
|
|
|
|
class _ControlledBigDashNestBumper extends BigDashNestBumper
|
|
|
|
with Controls<DashNestBumperController>, ScorePoints {
|
|
|
|
with Controls<DashNestBumperController>, ScorePoints {
|
|
|
|
_ControlledBigDashNestBumper({required String id}) : super() {
|
|
|
|
_ControlledBigDashNestBumper({required String id}) : super() {
|
|
|
|