Spaceball camera and perspective fixes + Karate Man animated background

This commit is contained in:
Starpelly
2021-12-30 07:17:22 -05:00
parent 5cbb182797
commit a52e883f3a
14 changed files with 322 additions and 75 deletions

View File

@ -15,11 +15,51 @@ namespace RhythmHeavenMania.Games.KarateMan
public Sprite[] ObjectSprites;
public List<BGSpriteC> BGSprites;
public SpriteRenderer BGSprite;
private bool bgEnabled;
private int newBeat;
[System.Serializable]
public class BGSpriteC
{
public List<Sprite> Sprites;
}
private void Awake()
{
instance = this;
}
private void Update()
{
if (bgEnabled)
{
if (Conductor.instance.songPositionInBeats > newBeat)
{
if (newBeat % 2 == 0)
BGSprite.sprite = BGSprites[0].Sprites[1];
else
BGSprite.sprite = BGSprites[0].Sprites[2];
newBeat++;
}
}
}
public void BGFXOn()
{
bgEnabled = true;
newBeat = Mathf.RoundToInt(Conductor.instance.songPositionInBeats);
}
public void BGFXOff()
{
bgEnabled = false;
BGSprite.sprite = BGSprites[0].Sprites[0];
}
public void Shoot(float beat, int type)
{
GameObject pot = Instantiate(Pot);
@ -48,6 +88,10 @@ namespace RhythmHeavenMania.Games.KarateMan
Jukebox.PlayOneShotGame("karateman/objectOut");
p.hitSnd = "karateman/rockHit";
break;
case 3:
Jukebox.PlayOneShotGame("karateman/objectOut");
p.hitSnd = "karateman/soccerHit";
break;
}
}