Merge pull request #54 from CarsonKompon/drumming-practice-background-colour

Added Streaks and Set Background Color to Drumming Practice
This commit is contained in:
Jenny Crowe 2022-03-15 16:22:08 -07:00 committed by GitHub
commit 8455cc4c30
4 changed files with 1250 additions and 5 deletions

File diff suppressed because it is too large Load diff

View file

@ -65,8 +65,10 @@ namespace HeavenStudio.Games.Scripts_DrummingPractice
if(player && force)
{
if (hit)
{
HitSound(applause);
else
DrummingPractice.instance.Streak();
} else
MissSound();
}

View file

@ -27,7 +27,9 @@ namespace HeavenStudio.Games
}
[Header("References")]
public SpriteRenderer background;
public SpriteRenderer backgroundGradient;
public SpriteRenderer[] streaks;
public Drummer player;
public Drummer leftDrummer;
public Drummer rightDrummer;
@ -58,6 +60,12 @@ namespace HeavenStudio.Games
Bop();
}
}
foreach (SpriteRenderer streak in streaks)
{
Color col = streak.color;
streak.color = new Color(col.r, col.g, col.b, Mathf.Lerp(col.a, 0, 3.5f * Time.deltaTime));
}
}
public void SetBop(float beat, float length)
@ -145,5 +153,24 @@ namespace HeavenStudio.Games
SetFaces(0);
}
public void SetBackgroundColor(Color col1, Color col2, Color col3)
{
backgroundGradient.color = col1;
background.color = col2;
foreach(SpriteRenderer streak in streaks)
{
streak.color = new Color(col3.r, col3.g, col3.b, streak.color.a);
}
}
public void Streak()
{
foreach (SpriteRenderer streak in streaks)
{
Color col = streak.color;
streak.color = new Color(col.r, col.g, col.b, 0.7f);
}
}
}
}

View file

@ -407,6 +407,12 @@ namespace HeavenStudio
new Param("type3", DrummingPractice.MiiType.Random, "Right Mii", "The Mii on the right"),
new Param("toggle", false, "Set All to Player", "Sets all Miis to the Player's Mii")
}),
new GameAction("set background color", delegate {var e = eventCaller.currentEntity; DrummingPractice.instance.SetBackgroundColor(e.colorA, e.colorB, e.colorC); }, 0.5f, false, new List<Param>()
{
new Param("colorA", new Color(43/255f, 207/255f, 51/255f), "Color A", "The top-most color of the background gradient"),
new Param("colorB", new Color(1, 1, 1), "Color B", "The bottom-most color of the background gradient"),
new Param("colorC", new Color(1, 247/255f, 0), "Streak Color", "The color of streaks that appear on a successful hit")
})
}),
new Minigame("blueBear", "Blue Bear \n<color=#eb5454>[WIP don't use]</color>", "B4E6F6", false, false, new List<GameAction>()