Speedy berry fixes

This commit is contained in:
2025-06-10 17:57:30 -07:00
parent 932d93fb3f
commit ab302ef19c

View File

@@ -337,11 +337,18 @@ public class GamePlayer : MonoBehaviour
void SpawnBerries() void SpawnBerries()
{ {
if (!(Time.time >= nextSpawnTime)) if (Time.time < nextSpawnTime)
{ {
return; return;
} }
if (speedyLeft > 0)
{
nextSpawnTime = Time.time + 1f / (spawnRate * 1.875f);
}
else
{
nextSpawnTime = Time.time + 1f / spawnRate; nextSpawnTime = Time.time + 1f / spawnRate;
}
float spawnProbability = Random.value; float spawnProbability = Random.value;
if (!pausePanel.activeSelf) if (!pausePanel.activeSelf)
{ {
@@ -614,6 +621,7 @@ public class GamePlayer : MonoBehaviour
score = 0; score = 0;
boostLeft = 0f; boostLeft = 0f;
slownessLeft = 0f; slownessLeft = 0f;
speedyLeft = 0f;
UpdateStats(0); UpdateStats(0);
GameObject[] berries = GameObject.FindGameObjectsWithTag("Berry"); GameObject[] berries = GameObject.FindGameObjectsWithTag("Berry");
GameObject[] poisonberries = GameObject.FindGameObjectsWithTag("PoisonBerry"); GameObject[] poisonberries = GameObject.FindGameObjectsWithTag("PoisonBerry");