missing stuff

This commit is contained in:
Rapandrasmus 2023-10-07 23:03:29 +02:00
parent 4f5c69859b
commit 7ac6cd2720
3 changed files with 28 additions and 4 deletions

View file

@ -112,6 +112,8 @@ namespace HeavenStudio.Games
private double _jumpBeat = double.MaxValue; private double _jumpBeat = double.MaxValue;
public bool MonkeyMissed = false;
public static AnimalAcrobat instance; public static AnimalAcrobat instance;
private void Awake() private void Awake()

View file

@ -14,6 +14,8 @@ namespace HeavenStudio.Games.Scripts_AnimalAcrobat
private Sound _drumRollSound; private Sound _drumRollSound;
private PlayerActionEvent _releaseAction;
private void Awake() private void Awake()
{ {
_game = AnimalAcrobat.instance; _game = AnimalAcrobat.instance;
@ -28,8 +30,8 @@ namespace HeavenStudio.Games.Scripts_AnimalAcrobat
public void Init(double beat, bool beforeGiraffe) public void Init(double beat, bool beforeGiraffe)
{ {
_game.ScheduleInput(beat - 1, 1, InputType.STANDARD_DOWN, beforeGiraffe ? JustHoldGiraffe : JustHold, Empty, Empty); _game.ScheduleInput(beat - 1, 1, InputType.STANDARD_DOWN, beforeGiraffe ? JustHoldGiraffe : JustHold, Miss, Empty);
_game.ScheduleInput(beat, 4, InputType.STANDARD_UP, JustRelease, Empty, Empty); _releaseAction = _game.ScheduleInput(beat, 4, InputType.STANDARD_UP, JustRelease, Miss, Empty);
_monkey.gameObject.SetActive(false); _monkey.gameObject.SetActive(false);
MultiSound.Play(new MultiSound.Sound[] MultiSound.Play(new MultiSound.Sound[]
@ -107,6 +109,15 @@ namespace HeavenStudio.Games.Scripts_AnimalAcrobat
}); });
} }
private void Miss(PlayerActionEvent caller)
{
if (_game.MonkeyMissed) return;
SoundByte.PlayOneShotGame("animalAcrobat/miss");
_releaseAction?.Disable();
_releaseAction?.QueueDeletion();
_game.MonkeyMissed = true;
}
private void Empty(PlayerActionEvent caller) { } private void Empty(PlayerActionEvent caller) { }
} }
} }

View file

@ -14,6 +14,8 @@ namespace HeavenStudio.Games.Scripts_AnimalAcrobat
private AnimalAcrobat _game; private AnimalAcrobat _game;
private PlayerActionEvent _releaseAction;
private void Awake() private void Awake()
{ {
_game = AnimalAcrobat.instance; _game = AnimalAcrobat.instance;
@ -23,8 +25,8 @@ namespace HeavenStudio.Games.Scripts_AnimalAcrobat
public void Init(double beat, bool beforeGiraffe) public void Init(double beat, bool beforeGiraffe)
{ {
_game.ScheduleInput(beat - 1, 1, InputType.STANDARD_DOWN, beforeGiraffe ? JustHoldGiraffe : JustHold, Empty, Empty); _game.ScheduleInput(beat - 1, 1, InputType.STANDARD_DOWN, beforeGiraffe ? JustHoldGiraffe : JustHold, Miss, Empty);
_game.ScheduleInput(beat, _holdLength, InputType.STANDARD_UP, JustRelease, Empty, Empty); _releaseAction = _game.ScheduleInput(beat, _holdLength, InputType.STANDARD_UP, JustRelease, Miss, Empty);
_monkey.gameObject.SetActive(false); _monkey.gameObject.SetActive(false);
MultiSound.Play(new MultiSound.Sound[] MultiSound.Play(new MultiSound.Sound[]
@ -77,6 +79,15 @@ namespace HeavenStudio.Games.Scripts_AnimalAcrobat
_game.PlayerJump(caller.startBeat + caller.timer, false); _game.PlayerJump(caller.startBeat + caller.timer, false);
} }
private void Miss(PlayerActionEvent caller)
{
if (_game.MonkeyMissed) return;
SoundByte.PlayOneShotGame("animalAcrobat/miss");
_releaseAction?.Disable();
_releaseAction?.QueueDeletion();
_game.MonkeyMissed = true;
}
private void Empty(PlayerActionEvent caller) { } private void Empty(PlayerActionEvent caller) { }
} }
} }