TO SQUASH: Fixed issue.

This commit is contained in:
2026-08-27 15:34:06 -04:00
parent 21b0fd7648
commit 04ccf01eb4
6 changed files with 117 additions and 14 deletions
+4 -2
View File
@@ -6,6 +6,8 @@ public class SharkSpawner : Spawner
public SpriteRenderer gameBoardSpriteRenderer;
public Player player;
private Bounds gameBoardBounds;
private float spawnTimer = 0f;
@@ -28,7 +30,7 @@ public class SharkSpawner : Spawner
{
spawnTimer += Time.fixedDeltaTime;
if (spawnTimer >= 1f && isActive && isSpawning)
if (spawnTimer >= 1f && isActive && isSpawning && player.level >= 10)
{
spawnTimer = 0f;
if (Random.value < spawnProbability)
@@ -36,7 +38,7 @@ public class SharkSpawner : Spawner
GameObject shark = Instantiate(sharkPrefab, spawnPosition, Quaternion.identity);
Shark sharkScript = shark.GetComponent<Shark>();
sharkScript.gameBoardSpriteRenderer = gameBoardSpriteRenderer;
sharkScript.player = FindAnyObjectByType<Player>();
sharkScript.player = player;
isActive = false;
}
}