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

added spawning of stairs

parent 207656f9
No related branches found
No related tags found
1 merge request!79Ruud1
using System.Collections; using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using System.Security.Cryptography;
using UnityEngine; using UnityEngine;
namespace Bigsock namespace Bigsock
...@@ -15,7 +16,7 @@ namespace Bigsock ...@@ -15,7 +16,7 @@ namespace Bigsock
public override void RunProceduralGeneration() public override void RunProceduralGeneration()
{ {
roomList.Clear(); roomList.Clear();
for (int i = 0; i <= RoomCount - 1; i++) for (int i = 0; i <= RoomCount - 1; i++)
{ {
int randomMap = Random.Range(0, mapParam.Length); int randomMap = Random.Range(0, mapParam.Length);
...@@ -29,6 +30,7 @@ namespace Bigsock ...@@ -29,6 +30,7 @@ namespace Bigsock
roomList.Add(bossMap); roomList.Add(bossMap);
tilemapGenerator.RenderMap(roomList[roomList.Count - 1],roomList.Count - 1, true); tilemapGenerator.RenderMap(roomList[roomList.Count - 1],roomList.Count - 1, true);
tilemapGenerator.SpawnBoss(bossMap, roomList.Count - 1); tilemapGenerator.SpawnBoss(bossMap, roomList.Count - 1);
tilemapGenerator.SpawnStairs(bossMap, roomList.Count - 1);
tilemapGenerator.polyCollider(roomList[0], 0); tilemapGenerator.polyCollider(roomList[0], 0);
} }
......
...@@ -15,7 +15,7 @@ namespace Bigsock ...@@ -15,7 +15,7 @@ namespace Bigsock
[SerializeField] GameObject Door; [SerializeField] GameObject Door;
[SerializeField] GameObject[] Enemy; [SerializeField] GameObject[] Enemy;
[SerializeField] GameObject Boss; [SerializeField] GameObject Boss;
//[SerializeField] GameObject Stairs; [SerializeField] GameObject Stairs;
[SerializeField] GameObject Chest; [SerializeField] GameObject Chest;
private int z_value = 0; private int z_value = 0;
private static int roomID = 0; private static int roomID = 0;
...@@ -353,13 +353,11 @@ namespace Bigsock ...@@ -353,13 +353,11 @@ namespace Bigsock
} }
} }
/*
public void SpawnStairs(int[,] bossRoom, int roomNr) public void SpawnStairs(int[,] bossRoom, int roomNr)
{ {
Instantiate(Stairs, new Vector3(FloorTilemap[roomNr].transform.position.x + bossRoom.GetUpperBound(0) / 2, Instantiate(Stairs, new Vector3(FloorTilemap[roomNr].transform.position.x + bossRoom.GetUpperBound(0) / 2,
FloorTilemap[roomNr].transform.position.y + bossRoom.GetUpperBound(1) / 2, 0), Quaternion.identity); FloorTilemap[roomNr].transform.position.y + bossRoom.GetUpperBound(1) - 3, 0), Quaternion.identity);
} }
*/
//Spawns a chest in the middle of the room //Spawns a chest in the middle of the room
public void spawnChest(int[,] room, int roomNr) public void spawnChest(int[,] room, int roomNr)
......
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