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:
kkuhn317
2023-01-16 20:15:06 -05:00
committed by GitHub
parent 4a92db679a
commit ab30f1a88e
109 changed files with 16290 additions and 1630 deletions

View File

@ -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;
}
}
}
}