mirror of
https://github.com/RHeavenStudio/HeavenStudio.git
synced 2025-06-12 08:27:40 +02:00
Catchy Tune: New sprites, animations, bug fixes (#204)
* catchy tune setup work, animations * more catchy tune progress * catchy tune: gameplay implemented, animation adjustments * more animation work catchy tune * more animation work catchy tune * adjust icon metadata * code cleanup left remarks for minigame developer * Catchy Tune new sprites * Catchy Tune miss animations, fix bugs * barely animation * Catchy Tune several things * barely sounds * miss animation for pineapple * background for catchy tune 2 * new game action for switching bg * Catchy Tune cleanup, asset bundle Co-authored-by: minenice55 <star.elementa@gmail.com>
This commit is contained in:
@ -2,8 +2,8 @@ using System;
|
||||
|
||||
public static class AppInfo {
|
||||
//--- AutoGenerated.begin
|
||||
public const string Version = "0.0.963";
|
||||
public static readonly DateTime Date = new DateTime(2023, 01, 12, 00, 27, 14, 138, DateTimeKind.Utc);
|
||||
public const string Version = "0.0.964";
|
||||
public static readonly DateTime Date = new DateTime(2023, 01, 15, 23, 58, 17, 115, DateTimeKind.Utc);
|
||||
//--- AutoGenerated.end
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,4 @@
|
||||
using DG.Tweening;
|
||||
using NaughtyBezierCurves;
|
||||
using HeavenStudio.Util;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@ -46,8 +45,22 @@ namespace HeavenStudio.Games.Loaders
|
||||
new Param("left" , true, "Left", "Plalin bops head"),
|
||||
new Param("right", true, "Right", "Alalin bops head")
|
||||
},
|
||||
},
|
||||
new GameAction("background", "Background")
|
||||
{
|
||||
function = delegate {var e = eventCaller.currentEntity; CatchyTune.instance.changeBG(e["BG"]); },
|
||||
defaultLength = 0.5f,
|
||||
parameters = new List<Param>()
|
||||
{
|
||||
new Param("BG", CatchyTune.Background.Long, "BG", "The background to change to")
|
||||
},
|
||||
}
|
||||
});
|
||||
},
|
||||
new List<string>() {"ctr", "normal"},
|
||||
"ctrcatchy",
|
||||
"en",
|
||||
new List<string>(){}
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -65,6 +78,12 @@ namespace HeavenStudio.Games
|
||||
Both
|
||||
}
|
||||
|
||||
public enum Background
|
||||
{
|
||||
Short,
|
||||
Long
|
||||
}
|
||||
|
||||
|
||||
[Header("Animators")]
|
||||
public Animator plalinAnim; // Left d-pad
|
||||
@ -74,9 +93,11 @@ namespace HeavenStudio.Games
|
||||
public GameObject orangeBase;
|
||||
public GameObject pineappleBase;
|
||||
public Transform fruitHolder;
|
||||
|
||||
public GameObject heartMessage;
|
||||
|
||||
public GameObject bg1;
|
||||
public GameObject bg2;
|
||||
|
||||
// when to stop playing the catch animation
|
||||
private float stopCatchLeft = 0f;
|
||||
private float stopCatchRight = 0f;
|
||||
@ -125,13 +146,13 @@ namespace HeavenStudio.Games
|
||||
// print("current beat: " + conductor.songPositionInBeats);
|
||||
if (stopCatchLeft > 0 && stopCatchLeft <= cond.songPositionInBeats)
|
||||
{
|
||||
plalinAnim.SetTrigger("stopCatch");
|
||||
plalinAnim.Play("idle", 0, 0);
|
||||
stopCatchLeft = 0;
|
||||
}
|
||||
|
||||
if (stopCatchRight > 0 && stopCatchRight <= cond.songPositionInBeats)
|
||||
{
|
||||
alalinAnim.SetTrigger("stopCatch");
|
||||
alalinAnim.Play("idle", 0, 0);
|
||||
stopCatchRight = 0;
|
||||
}
|
||||
|
||||
@ -147,8 +168,8 @@ namespace HeavenStudio.Games
|
||||
if (stopSmile > 0 && stopSmile <= cond.songPositionInBeats)
|
||||
{
|
||||
//print("smile stop");
|
||||
plalinAnim.SetTrigger("stopSmile");
|
||||
alalinAnim.SetTrigger("stopSmile");
|
||||
plalinAnim.Play("stopsmile", 1, 0);
|
||||
alalinAnim.Play("stopsmile", 1, 0);
|
||||
stopSmile = 0;
|
||||
heartMessage.SetActive(false);
|
||||
}
|
||||
@ -157,7 +178,7 @@ namespace HeavenStudio.Games
|
||||
{
|
||||
if (bopLeft && stopCatchLeft == 0)
|
||||
{
|
||||
plalinAnim.Play("bop", 0, 0);
|
||||
plalinAnim.SetTrigger("bop");
|
||||
}
|
||||
|
||||
if (bopRight && stopCatchRight == 0)
|
||||
@ -245,6 +266,20 @@ namespace HeavenStudio.Games
|
||||
bopRight = right;
|
||||
}
|
||||
|
||||
public void changeBG(int bg)
|
||||
{
|
||||
if (bg == 0)
|
||||
{
|
||||
bg1.SetActive(true);
|
||||
bg2.SetActive(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
bg1.SetActive(false);
|
||||
bg2.SetActive(true);
|
||||
}
|
||||
}
|
||||
|
||||
public void catchSuccess(bool side, bool isPineapple, bool smile, float beat)
|
||||
{
|
||||
string anim = isPineapple ? "catchPineapple" : "catchOrange";
|
||||
@ -265,6 +300,7 @@ namespace HeavenStudio.Games
|
||||
startSmile = beat + 1f;
|
||||
stopSmile = beat + 2f;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void catchMiss(bool side, bool isPineapple)
|
||||
@ -272,14 +308,48 @@ namespace HeavenStudio.Games
|
||||
// not the right sound at all but need an accurate rip
|
||||
Jukebox.PlayOneShotGame("catchyTune/fruitThrough");
|
||||
|
||||
// hurt animation here
|
||||
float beat = Conductor.instance.songPositionInBeats;
|
||||
|
||||
string fruitType = isPineapple ? "Pineapple" : "Orange";
|
||||
|
||||
if (side)
|
||||
{
|
||||
alalinAnim.Play("miss" + fruitType, 0, 0);
|
||||
stopCatchRight = beat + 0.7f;
|
||||
}
|
||||
else
|
||||
{
|
||||
plalinAnim.Play("miss" + fruitType, 0, 0);
|
||||
stopCatchLeft = beat + 0.7f;
|
||||
}
|
||||
}
|
||||
|
||||
public void catchWhiff(bool side)
|
||||
{
|
||||
Jukebox.PlayOneShotGame("catchyTune/whiff");
|
||||
whiffAnim(side);
|
||||
}
|
||||
|
||||
public void catchBarely(bool side)
|
||||
{
|
||||
Jukebox.PlayOneShotGame("catchyTune/barely left");
|
||||
whiffAnim(side);
|
||||
}
|
||||
|
||||
public void whiffAnim(bool side)
|
||||
{
|
||||
float beat = Conductor.instance.songPositionInBeats;
|
||||
|
||||
// whiff animation here
|
||||
if (side)
|
||||
{
|
||||
alalinAnim.Play("whiff", 0, 0);
|
||||
stopCatchRight = beat + 0.5f;
|
||||
}
|
||||
else
|
||||
{
|
||||
plalinAnim.Play("whiff", 0, 0);
|
||||
stopCatchLeft = beat + 0.5f;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2,7 +2,6 @@ using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
using UnityEngine;
|
||||
using NaughtyBezierCurves;
|
||||
|
||||
using HeavenStudio.Util;
|
||||
|
||||
@ -18,6 +17,8 @@ namespace HeavenStudio.Games.Scripts_CatchyTune
|
||||
|
||||
public bool side;
|
||||
|
||||
public float barelyStart = 0f;
|
||||
|
||||
public bool smile;
|
||||
|
||||
private string soundText;
|
||||
@ -74,13 +75,14 @@ namespace HeavenStudio.Games.Scripts_CatchyTune
|
||||
// minenice: note - needs PlayerActionEvent implementation
|
||||
private void Update()
|
||||
{
|
||||
Conductor cond = Conductor.instance;
|
||||
float tempo = cond.songBpm;
|
||||
float playbackSpeed = cond.musicSource.pitch;
|
||||
|
||||
anim.DoScaledAnimation("fruit bounce", startBeat, beatLength + (isPineapple ? 1f : 0.5f));
|
||||
|
||||
float normalizedBeat = Conductor.instance.GetPositionFromBeat(startBeat, beatLength);
|
||||
if (barelyStart > 0f)
|
||||
{
|
||||
anim.DoScaledAnimation("barely", barelyStart, isPineapple ? 2f : 1f);
|
||||
}
|
||||
else
|
||||
{
|
||||
anim.DoScaledAnimation("fruit bounce", startBeat, beatLength + (isPineapple ? 4f : 2f));
|
||||
}
|
||||
}
|
||||
|
||||
public static void PlaySound(float startBeat, bool side, bool isPineapple)
|
||||
@ -133,10 +135,29 @@ namespace HeavenStudio.Games.Scripts_CatchyTune
|
||||
|
||||
private void CatchFruit(PlayerActionEvent caller, float state)
|
||||
{
|
||||
//minenice: TODO - near misses (-1 > state > 1)
|
||||
Jukebox.PlayOneShotGame(soundText + "Catch");
|
||||
game.catchSuccess(side, isPineapple, smile, startBeat + beatLength);
|
||||
Destroy(this.gameObject);
|
||||
|
||||
if (state <= -1f || state >= 1f)
|
||||
{
|
||||
//near miss (barely)
|
||||
barelyStart = Conductor.instance.songPositionInBeats;
|
||||
|
||||
game.catchBarely(side);
|
||||
|
||||
// play near miss animation
|
||||
anim.DoScaledAnimation("barely", barelyStart, isPineapple ? 2f : 1f);
|
||||
|
||||
BeatAction.New(gameObject, new List<BeatAction.Action>()
|
||||
{
|
||||
new BeatAction.Action(barelyStart + (isPineapple ? 2f : 1f), delegate { Destroy(this.gameObject); }),
|
||||
});
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
Jukebox.PlayOneShotGame(soundText + "Catch");
|
||||
game.catchSuccess(side, isPineapple, smile, startBeat + beatLength);
|
||||
Destroy(this.gameObject);
|
||||
}
|
||||
}
|
||||
|
||||
private void Miss(PlayerActionEvent caller)
|
||||
@ -145,7 +166,7 @@ namespace HeavenStudio.Games.Scripts_CatchyTune
|
||||
|
||||
BeatAction.New(gameObject, new List<BeatAction.Action>()
|
||||
{
|
||||
new BeatAction.Action(startBeat + beatLength + (isPineapple ? 1f : 0.5f), delegate { Destroy(this.gameObject); }),
|
||||
new BeatAction.Action(startBeat + beatLength + (isPineapple ? 3f : 1.5f), delegate { Destroy(this.gameObject); }),
|
||||
});
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user