offset spawning of gladiator to avoid stacking

This commit is contained in:
Soulaha Balde 2022-04-03 16:15:24 -04:00
parent ef113a6a43
commit facb2b51fe

View File

@ -45,7 +45,9 @@ public class Arena : MonoBehaviour {
var gladiator = Instantiate(entityPrefab, gladiatorParent).GetComponent<Gladiator>(); var gladiator = Instantiate(entityPrefab, gladiatorParent).GetComponent<Gladiator>();
gladiator.arena = this; gladiator.arena = this;
gladiator.transform.position = spawners[spawnerIndex].position; float randFloat = Random.Range(0.1f, 0.5f);
Vector2 offset = new Vector2(randFloat, randFloat);
gladiator.transform.position = spawners[spawnerIndex].position + offset;
gladiator.direction = spawners[spawnerIndex].direction; gladiator.direction = spawners[spawnerIndex].direction;
gladiator.gameFlowManager = gameFlowManager; gladiator.gameFlowManager = gameFlowManager;
} }