Skip to content
Snippets Groups Projects
Commit c527188a authored by Robin Ruud Kristensen's avatar Robin Ruud Kristensen
Browse files

maybe fixed spawning of enemies

parent 010c6fad
No related branches found
No related tags found
2 merge requests!76Juliuses nye super branch,!67maybe fixed spawning of enemies
......@@ -252,7 +252,9 @@ namespace Bigsock
{
int enemyRandom = Random.Range(0, Enemy.Length);
int randomLocation_x = Random.Range(1, map.GetUpperBound(0) - 1);
if (randomLocation_x == DoorLocations[roomNr].x) randomLocation_x += 1;
int randomLocation_y = Random.Range(map.GetLowerBound(1) + 2, map.GetUpperBound(1) - 1);
if (randomLocation_x == DoorLocations[roomNr].y) randomLocation_y += 1;
Instantiate(Enemy[enemyRandom], new Vector3Int((int)FloorTilemap[roomNr].transform.position.x + randomLocation_x,
(int)FloorTilemap[roomNr].transform.position.y + randomLocation_y, 0), Quaternion.identity);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment