Begin bopping

monkey will do one bop
This commit is contained in:
blank3times 2024-01-26 22:55:50 -08:00
parent 71b75bce5e
commit 5a336c3605

View file

@ -18,9 +18,15 @@ namespace HeavenStudio.Games.Loaders
{
return new Minigame("holeInOne", "Hole in One", "6ab99e", false, false, new List<GameAction>()
{
new GameAction("testanims", "Test Animation") // Delete this one when the game is more competent
new GameAction("bop", "Bop")
{
function = delegate { HoleInOne.instance.DoTestAnim(eventCaller.currentEntity.beat); },
function = delegate { var e = eventCaller.currentEntity; HoleInOne.instance.ToggleBop(e.beat, e.length, e["bop"], e["autobop"]); },
resizable = true,
parameters = new List<Param>()
{
new Param("bop", true, "Bop", "Toggle if the characters should bop for the duration of this event."),
new Param("autobop", false, "Bop (Auto)", "Toggle if the characters should automatically bop until another Bop event is reached.")
}
},
new GameAction("mandrill", "Mandrill (no visuals)")
{
@ -54,13 +60,30 @@ namespace HeavenStudio.Games
void Awake()
{
HoleInOne.instance = this;
SetupBopRegion("holeInOne", "bop", "autoBop");
}
// Delete this one when the game is more competent
public void DoTestAnim(double beat)
public override void OnBeatPulse(double beat)
{
SoundByte.PlayOneShotGame("holeInOne/whale");
MonkeyAnim.Play("MonkeySpin");
if (BeatIsInBopRegion(beat)) MonkeyAnim.Play("MonkeyBop");
}
public void ToggleBop(double beat, float length, bool shouldBop, bool autoBop)
{
if (shouldBop)
{
for (int i = 0; i < length; i++)
{
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + i, delegate
{
MonkeyAnim.Play("MonkeyBop");
// TODO add bops for other characters
})
});
}
}
}
public void DoMandrill(double beat)