|
|
@ -29,7 +29,13 @@ class RampShotBehavior extends Component
|
|
|
|
void onMount() {
|
|
|
|
void onMount() {
|
|
|
|
super.onMount();
|
|
|
|
super.onMount();
|
|
|
|
|
|
|
|
|
|
|
|
final sensors = parent.children.whereType<RampSensor>();
|
|
|
|
final sensors = parent
|
|
|
|
|
|
|
|
.descendants()
|
|
|
|
|
|
|
|
.whereType<SpaceshipRamp>()
|
|
|
|
|
|
|
|
.first
|
|
|
|
|
|
|
|
.descendants()
|
|
|
|
|
|
|
|
.whereType<RampSensor>();
|
|
|
|
|
|
|
|
|
|
|
|
for (final sensor in sensors) {
|
|
|
|
for (final sensor in sensors) {
|
|
|
|
sensor.bloc.stream.listen((state) {
|
|
|
|
sensor.bloc.stream.listen((state) {
|
|
|
|
switch (state.type) {
|
|
|
|
switch (state.type) {
|
|
|
@ -58,7 +64,7 @@ class RampShotBehavior extends Component
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void _shot() {
|
|
|
|
void _shot() {
|
|
|
|
parent.spaceshipRamp.progress();
|
|
|
|
parent.descendants().whereType<SpaceshipRamp>().first.progress();
|
|
|
|
|
|
|
|
|
|
|
|
gameRef.read<GameBloc>()
|
|
|
|
gameRef.read<GameBloc>()
|
|
|
|
..add(const MultiplierIncreased())
|
|
|
|
..add(const MultiplierIncreased())
|
|
|
|