public override LevelMap generateRoom() { LevelMap _map = new LevelMap(); //This Room will introduce the player to the non-euclidean spaces List <LevelEditor_2.TileCoord> emptyTiles = new List <LevelEditor_2.TileCoord>(); emptyTiles.Add(new LevelEditor_2.TileCoord(2, 1)); Node[,] chunk1 = LevelEditor_2.createChunk(_map, new Color32(244, 173, 66, 255), 5, 3, emptyTiles); Node[,] chunk2 = LevelEditor_2.createChunk(_map, Color.red, 1, 10); LevelEditor_2.createTwoWayLink( chunk1, chunk2, new LevelEditor_2.TileCoord(2, 0), new LevelEditor_2.TileCoord(0, 0), GameManager.Direction.South ); LevelEditor_2.createTwoWayLink( chunk1, chunk2, new LevelEditor_2.TileCoord(2, 2), new LevelEditor_2.TileCoord(0, 9), GameManager.Direction.North ); LevelEditor_2.setSource(_map, chunk1, new LevelEditor_2.TileCoord(0, 0)); LevelEditor_2.setTarget(_map, chunk1, new LevelEditor_2.TileCoord(4, 2)); return(_map); }
/// <summary> /// /// </summary> public void updateCornerDrawing() { getCurrentMap(); getCurrentNode(); LevelEditor_2.setCornerDrawing(currentMap); GameManager.gameplay.nonEuclidRenderer.HandleRender(GameManager.Direction.East, GameManager.gameplay.currentPosition, false); }
/// <summary> /// Creates a link from the current tile and in the direction given by methodDirection, to the /// node indicated by the linkToIndex. /// Also called by the createTileChunk() method in order to ensure that the player can access the /// newly created chunk, in which case it used the (x,y) coordinates given by (linkX, LinkY) /// </summary> /// <param name="newChunk"></param> public void createLink(bool newChunk = false) { getCurrentNode(); // make sure node reference is current getCurrentMap(); // make sure map reference is current if (newChunk) // if creating a link to a new chunk, use this method to create link { if ((linkX >= 0) && (linkY >= 0) && (linkX < newChunkWidth) && (linkY < newChunkHeight)) { int toIndex = chunkToLink[(int)linkX, (int)linkY].index; LevelEditor_2.createTwoWayLink(currentMap, currentNode.index, toIndex, methodDirection); } else { Debug.Log("Error: The location to link to: (" + linkX + "," + linkY + ") the the new chunk the is " + newChunkWidth + "x" + newChunkHeight + " is not valid"); } } else if ((linkToIndex >= 0) && (linkToIndex < currentMap.size) && (currentMap[linkToIndex] != null)) // otherwisse use this method to create link { if (linkDirectionality == LinkDirectionality.Twoway) { LevelEditor_2.createTwoWayLink(currentMap, currentNode.index, (int)linkToIndex, methodDirection); } else { LevelEditor_2.createOneWayLink(currentMap, currentNode.index, (int)linkToIndex, methodDirection); } } else { Debug.Log("Error: Given index of " + linkToIndex + " is not valid"); } getCurrentNode(); // current node will have changed slightly, make sure copy is still accurate GameManager.gameplay.nonEuclidRenderer.HandleRender(GameManager.Direction.East, currentNode, false); // draw changes to map }
/// <summary> /// Saves a level using the given name and filepath within the assest folder /// Note that this is a relative filepath from the assests folder, not the absolute filepath /// </summary> public void saveLevel() { //Debug.Log("WTF, is this not being called?"); getCurrentMap(); // make sure map reference is current LevelEditor_2.cleanUpMap(currentMap); // clean up the map, removing deleted or invalid tiles if (File.Exists(Application.dataPath + levelPath + "/room_" + levelName + ".json")) // if it already exists, check wether the person intends to overwrite it { if (overwriteLevel) { LevelMap.Save(currentMap, Application.dataPath + levelPath + "/room_" + levelName + ".json"); Debug.Log("Overwriting level at: \"" + Application.dataPath + levelPath + "/room_" + levelName + ".json\""); overwriteLevel = false; } else { // If the overwriteLevel boolean is not set, do not overwrite the level Debug.Log("Are you sure you want to overwrite the level at: \"" + Application.dataPath + levelPath + "/room_" + levelName + ".json\" ?"); } } else { // if it doesn't already exit, don't need to make any checks. Debug.Log("Saving level at: \"" + Application.dataPath + levelPath + "/room_" + levelName + ".json\""); LevelMap.Save(currentMap, Application.dataPath + levelPath + "/room_" + levelName + ".json"); } }
public static Map generateRoom() { Map demoMap = new Map(); // This map is a long room, with a walled off walway in the middle. // The hallway looks short from the outside, and long from the inside List <LevelEditor_2.TileCoord> emptyTiles = new List <LevelEditor_2.TileCoord>(); emptyTiles.Add(new LevelEditor_2.TileCoord(2, 2)); Node[,] chunk1 = LevelEditor_2.createChunk(demoMap, new Color32(255, 255, 0, 255), 5, 5, emptyTiles); Node[,] chunk2 = LevelEditor_2.createChunk(demoMap, new Color32(0, 155, 255, 255), 5, 1); LevelEditor_2.createTwoWayLink( chunk1, chunk2, new LevelEditor_2.TileCoord(1, 2), new LevelEditor_2.TileCoord(0, 0), LevelEditor_2.Direction.East ); LevelEditor_2.createTwoWayLink( chunk1, chunk2, new LevelEditor_2.TileCoord(3, 2), new LevelEditor_2.TileCoord(4, 0), LevelEditor_2.Direction.West ); LevelEditor_2.setSource(chunk1, new LevelEditor_2.TileCoord(0, 0)); LevelEditor_2.setTarget(chunk2, new LevelEditor_2.TileCoord(2, 0)); return(demoMap); }
/// <summary> /// Set the type of the current tile /// </summary> public void setType() { getCurrentNode(); getCurrentMap(); LevelEditor_2.setType(currentMap, currentNode.index, type); getCurrentNode(); GameManager.gameplay.nonEuclidRenderer.HandleRender(GameManager.Direction.East, currentNode, false); // draw changes to map }
override public LevelMap generateRoom() { LevelMap demoMap = new LevelMap(); demoMap.stringleft = 10; // This room has two hallways that go through the middle. // both of the hallways are longer from the inside than the outside, // and the hallways are also at 90 degrees to each other, passing through the same space. List <LevelEditor_2.TileCoord> emptyTiles = new List <LevelEditor_2.TileCoord>(); emptyTiles.Add(new LevelEditor_2.TileCoord(1, 1)); Node[,] chunk1 = LevelEditor_2.createChunk(demoMap, new Color32(255, 0, 0, 255), 3, 3, emptyTiles); Node[,] chunk2 = LevelEditor_2.createChunk(demoMap, new Color32(0, 255, 0, 255), 2, 1); Node[,] chunk3 = LevelEditor_2.createChunk(demoMap, new Color32(0, 0, 255, 255), 1, 2); LevelEditor_2.createTwoWayLink( chunk1, chunk2, new LevelEditor_2.TileCoord(0, 1), new LevelEditor_2.TileCoord(0, 0), GameManager.Direction.East ); LevelEditor_2.createTwoWayLink( chunk1, chunk2, new LevelEditor_2.TileCoord(2, 1), new LevelEditor_2.TileCoord(1, 0), GameManager.Direction.West ); LevelEditor_2.createTwoWayLink( chunk1, chunk3, new LevelEditor_2.TileCoord(1, 0), new LevelEditor_2.TileCoord(0, 0), GameManager.Direction.South ); LevelEditor_2.createTwoWayLink( chunk1, chunk3, new LevelEditor_2.TileCoord(1, 2), new LevelEditor_2.TileCoord(0, 1), GameManager.Direction.North ); LevelEditor_2.setSource(demoMap, chunk1, new LevelEditor_2.TileCoord(0, 2)); LevelEditor_2.setTarget(demoMap, chunk1, new LevelEditor_2.TileCoord(2, 0)); return(demoMap); }
override public LevelMap generateRoom() { LevelMap demoMap = new LevelMap(); // This map is a long room, with a walled off walway in the middle. // The hallway looks short from the outside, and long from the inside List <LevelEditor_2.TileCoord> emptyTiles = new List <LevelEditor_2.TileCoord>(); emptyTiles.Add(new LevelEditor_2.TileCoord(2, 2)); List <LevelEditor_2.TileCoord> emptyTiles2 = new List <LevelEditor_2.TileCoord>(); emptyTiles2.Add(new LevelEditor_2.TileCoord(0, 1)); emptyTiles2.Add(new LevelEditor_2.TileCoord(0, 2)); emptyTiles2.Add(new LevelEditor_2.TileCoord(0, 3)); emptyTiles2.Add(new LevelEditor_2.TileCoord(0, 4)); emptyTiles2.Add(new LevelEditor_2.TileCoord(1, 1)); emptyTiles2.Add(new LevelEditor_2.TileCoord(1, 2)); emptyTiles2.Add(new LevelEditor_2.TileCoord(1, 3)); emptyTiles2.Add(new LevelEditor_2.TileCoord(1, 4)); emptyTiles2.Add(new LevelEditor_2.TileCoord(2, 1)); emptyTiles2.Add(new LevelEditor_2.TileCoord(2, 2)); emptyTiles2.Add(new LevelEditor_2.TileCoord(2, 3)); emptyTiles2.Add(new LevelEditor_2.TileCoord(2, 4)); emptyTiles2.Add(new LevelEditor_2.TileCoord(3, 1)); emptyTiles2.Add(new LevelEditor_2.TileCoord(3, 2)); emptyTiles2.Add(new LevelEditor_2.TileCoord(3, 3)); emptyTiles2.Add(new LevelEditor_2.TileCoord(3, 4)); Node[,] chunk1 = LevelEditor_2.createChunk(demoMap, new Color32(255, 255, 0, 255), 5, 5, emptyTiles); Node[,] chunk2 = LevelEditor_2.createChunk(demoMap, new Color32(0, 155, 255, 255), 5, 5, emptyTiles2); LevelEditor_2.createTwoWayLink( chunk1, chunk2, new LevelEditor_2.TileCoord(1, 2), new LevelEditor_2.TileCoord(0, 0), GameManager.Direction.East ); LevelEditor_2.createTwoWayLink( chunk1, chunk2, new LevelEditor_2.TileCoord(2, 3), new LevelEditor_2.TileCoord(4, 4), GameManager.Direction.North ); LevelEditor_2.setSource(demoMap, chunk1, new LevelEditor_2.TileCoord(0, 0)); LevelEditor_2.setTarget(demoMap, chunk2, new LevelEditor_2.TileCoord(4, 0)); return(demoMap); }
override public LevelMap generateRoom() { LevelMap demoMap = new LevelMap(); // simple map for 1st room, one chunk, not strange connections Node[,] chunk = LevelEditor_2.createChunk(demoMap, new Color32(255, 255, 255, 255), 3, 3); LevelEditor_2.setSource(demoMap, chunk, new LevelEditor_2.TileCoord(0, 1)); LevelEditor_2.setTarget(demoMap, chunk, new LevelEditor_2.TileCoord(2, 1)); return(demoMap); }
/// <summary> /// Creates a new map, with a starting area created using the same settings as the chunk creation. /// (0,0) is the default source node. /// Note that if changes to the previous map haven't been saved, they will be lost. /// </summary> public void getNewMap() { LevelMap tempMap = new LevelMap(); GameManager.gameplay.map = tempMap; // let gameplay & this have a new map currentMap = tempMap; createTileChunk(false); // create a new tile chunk in the new map LevelEditor_2.setType(tempMap, 0, Node.TileType.source); // set the suorce tile to (0,0) //currentMap = tempMap; //GameManager.instance.gameplay.map = tempMap; GameManager.gameplay.resetLevelAssets(); // reset player location & redraw everything }
override public LevelMap generateRoom() { LevelMap demoMap = new LevelMap(); // still a simple map for room 2, still one chunk but a bit larger Node[,] chunk = LevelEditor_2.createChunk(demoMap, new Color32(255, 200, 100, 255), 5, 5); LevelEditor_2.setSource(demoMap, chunk, new LevelEditor_2.TileCoord(0, 1)); LevelEditor_2.setTarget(demoMap, chunk, new LevelEditor_2.TileCoord(4, 3)); return(demoMap); }
public static Map generateRoom() { Map demoMap = new Map(); // This map demonstrates the ways that connects can be very wierd // Demonstrates cunfusing, undesired behavior List <LevelEditor_2.TileCoord> emptyTiles = new List <LevelEditor_2.TileCoord>(); emptyTiles.Add(new LevelEditor_2.TileCoord(0, 0)); emptyTiles.Add(new LevelEditor_2.TileCoord(0, 2)); emptyTiles.Add(new LevelEditor_2.TileCoord(2, 0)); emptyTiles.Add(new LevelEditor_2.TileCoord(2, 2)); Node[,] chunk = LevelEditor_2.createChunk(demoMap, new Color32(255, 255, 200, 255), 3, 3, emptyTiles); LevelEditor_2.createOneWayLink( chunk, chunk, new LevelEditor_2.TileCoord(1, 0), new LevelEditor_2.TileCoord(0, 1), LevelEditor_2.Direction.North ); LevelEditor_2.createOneWayLink( chunk, chunk, new LevelEditor_2.TileCoord(0, 1), new LevelEditor_2.TileCoord(1, 0), LevelEditor_2.Direction.West ); LevelEditor_2.createTwoWayLink( chunk, chunk, new LevelEditor_2.TileCoord(1, 2), new LevelEditor_2.TileCoord(2, 1), LevelEditor_2.Direction.South ); LevelEditor_2.createTwoWayLink( chunk, chunk, new LevelEditor_2.TileCoord(2, 1), new LevelEditor_2.TileCoord(1, 2), LevelEditor_2.Direction.East ); return(demoMap); }
/// <summary> /// remove connections between this tile and the tile in direction, creating a wall between them /// </summary> public void createWall() { getCurrentNode(); // make sure node copy is current getCurrentMap(); // make sure map reference is current if (currentNode[(int)methodDirection] < 0) // only try to run it there is actually a node in that direction { Debug.Log("Error: no node in that direction"); return; } LevelEditor_2.createWall(currentMap, currentNode.index, methodDirection); getCurrentNode(); // redraw the newly changed map GameManager.gameplay.nonEuclidRenderer.HandleRender(GameManager.Direction.East, currentNode, false); }
public override LevelMap generateRoom() { LevelMap _map = new LevelMap(); //This Room will show the player how to move and that they need to move a certain distance to complete a level Node[,] chunk1 = LevelEditor_2.createChunk(_map, new Color32(244, 173, 66, 255), 5, 3); LevelEditor_2.setSource(_map, chunk1, new LevelEditor_2.TileCoord(0, 0)); LevelEditor_2.setTarget(_map, chunk1, new LevelEditor_2.TileCoord(4, 0)); return(_map); }
override public LevelMap generateRoom() { LevelMap demoMap = new LevelMap(); // This map is a long room, with a walled off walway in the middle. // The hallway looks short from the outside, and long from the inside Node[,] chunk1 = LevelEditor_2.createChunk(demoMap, new Color32(255, 255, 0, 255), 20, 1); LevelEditor_2.setSource(demoMap, chunk1, new LevelEditor_2.TileCoord(0, 0)); LevelEditor_2.setTarget(demoMap, chunk1, new LevelEditor_2.TileCoord(6, 0)); return(demoMap); }
override public LevelMap generateRoom() { LevelMap demoMap = new LevelMap(); //Demo room map, relativly complex List <LevelEditor_2.TileCoord> emptyTiles1 = new List <LevelEditor_2.TileCoord>(); emptyTiles1.Add(new LevelEditor_2.TileCoord(1, 1)); //emptyTiles1.Add(new LevelEditor_2.TileCoord(2, 0)); //emptyTiles1.Add(new LevelEditor_2.TileCoord(1, 2)); Node[,] chunk1 = LevelEditor_2.createChunk(demoMap, new Color32(150, 150, 255, 255), 3, 3, emptyTiles1); Node[,] chunk2 = LevelEditor_2.createChunk(demoMap, new Color32(150, 150, 255, 255), 3, 3, emptyTiles1); LevelEditor_2.createTwoWayLink( chunk1, chunk2, new LevelEditor_2.TileCoord(2, 2), new LevelEditor_2.TileCoord(1, 0), GameManager.Direction.West ); LevelEditor_2.createTwoWayLink( chunk1, chunk2, new LevelEditor_2.TileCoord(1, 2), new LevelEditor_2.TileCoord(2, 0), GameManager.Direction.East ); LevelEditor_2.createOneWayLink( chunk1, chunk1, new LevelEditor_2.TileCoord(1, 2), new LevelEditor_2.TileCoord(2, 2), GameManager.Direction.East ); LevelEditor_2.setSource(demoMap, chunk1, new LevelEditor_2.TileCoord(1, 0)); //LevelEditor_2.setTarget(demoMap, chunk6, new LevelEditor_2.TileCoord(0, 0)); return(demoMap); }
/// <summary> /// Deletes the tile that is at the direction given by methodDirection. /// Can be used to screw up a map, so don't do that /// </summary> public void deleteTile() { //Debug.Log("deleteTile() does not do anything right now"); getCurrentNode(); // make sure node copy is current getCurrentMap(); // make sure map reference is current int tempIndex = currentNode[(int)methodDirection]; // get the node that this one connects to in that direction if (tempIndex >= 0) // can only delete that node if it exists { LevelEditor_2.deleteTile(currentMap, tempIndex); LevelEditor_2.cleanUpMap(currentMap); // clean up the node array inside map, so that it doesn't have gaps in the array. } else { Debug.Log("Error: There is no node the " + methodDirection.ToString() + "-ern direction"); } getCurrentNode(); // node copy now out of date, update it GameManager.gameplay.nonEuclidRenderer.HandleRender(GameManager.Direction.East, currentNode, false); // draw changes to map }
override public LevelMap generateRoom() { LevelMap demoMap = new LevelMap(); //Demo room map, relativly complex Node[,] chunk1 = LevelEditor_2.createChunk(demoMap, new Color32(255, 200, 100, 255), 3, 3); Node[,] chunk2 = LevelEditor_2.createChunk(demoMap, new Color32(100, 100, 255, 255), 3, 3); LevelEditor_2.createTwoWayLink( chunk1, chunk2, new LevelEditor_2.TileCoord(1, 0), new LevelEditor_2.TileCoord(1, 2), GameManager.Direction.North ); LevelEditor_2.createTwoWayLink( chunk1, chunk2, new LevelEditor_2.TileCoord(0, 1), new LevelEditor_2.TileCoord(2, 1), GameManager.Direction.West ); LevelEditor_2.createTwoWayLink( chunk2, chunk1, new LevelEditor_2.TileCoord(1, 0), new LevelEditor_2.TileCoord(1, 2), GameManager.Direction.North ); LevelEditor_2.createTwoWayLink( chunk2, chunk1, new LevelEditor_2.TileCoord(0, 1), new LevelEditor_2.TileCoord(2, 1), GameManager.Direction.West ); LevelEditor_2.setSource(demoMap, chunk1, new LevelEditor_2.TileCoord(1, 1)); LevelEditor_2.setTarget(demoMap, chunk2, new LevelEditor_2.TileCoord(1, 1)); return(demoMap); }
/// <summary> /// creates a rectalngular matrix of tiles that are already linked together. /// Also creates a link to this new collection of tiles, from the current ile, and in /// the indicated direction to the indicated (x,y) coordinates of the new chunk /// </summary> /// <param name="link"></param> public void createTileChunk(bool link = true) { getCurrentMap(); // make sure map reference is current Node[][,] temp = new Node[chunks.Length + 1][, ]; int i; for (i = 0; i < chunks.Length; i++) { temp[i] = chunks[i]; } chunks = temp; // create new chunk //chunks[i] = LevelEditor_2.createChunk(currentMap, new Color32(newChunkColorR, newChunkColorG, newChunkColorB, newChunkColorA), newChunkWidth, newChunkHeight); chunks[i] = LevelEditor_2.createChunk(currentMap, newChunkColor, newChunkWidth, newChunkHeight); chunkToLink = chunks[i]; if (link) { // create link to new chunk createLink(true); } }
/// <summary> /// update map from old version of node /// </summary> public void updateMapVer() { Debug.Log("Trying to load level at: \"" + Application.dataPath + levelPath + "/room_" + levelName + ".json\""); if (File.Exists(Application.dataPath + levelPath + "/room_" + levelName + ".json")) { LevelMap_old oldVer = LevelMap_old.Load(Application.dataPath + levelPath + "/room_" + levelName + ".json"); if (oldVer == null) { return; } LevelMap newVer = LevelMap_old.ConvertToNew(oldVer); LevelEditor_2.setCornerDrawing(newVer); GameManager.gameplay.map = newVer; LevelEditor_2.setCornerDrawing(newVer); GameManager.gameplay.currentPosition = GameManager.gameplay.map[GameManager.gameplay.map.sourceNodeIndex]; GameManager.gameplay.resetLevelAssets(); GameManager.gameplay.levelNameText.text = levelName; Debug.Log("Updated level at: \"" + Application.dataPath + levelPath + "/room_" + levelName + ".json\""); } else { Debug.Log("Error: Map file does not exist at path \"" + Application.dataPath + levelPath + "/room_" + levelName + ".json\""); } }
public static Map generateRoom() { Map demoMap = new Map(); //Demo room map, relativly complex List <LevelEditor_2.TileCoord> emptyTiles1 = new List <LevelEditor_2.TileCoord>(); emptyTiles1.Add(new LevelEditor_2.TileCoord(2, 0)); Node[,] chunk1 = LevelEditor_2.createChunk(demoMap, new Color32(244, 66, 66, 255), 5, 1); // Node[,] chunk2 = LevelEditor_2.createChunk(demoMap, new Color32(244, 155, 66, 255), 5, 1, emptyTiles1); Node[,] chunk3 = LevelEditor_2.createChunk(demoMap, new Color32(244, 244, 66, 255), 5, 1, emptyTiles1); // Node[,] chunk4 = LevelEditor_2.createChunk(demoMap, new Color32(155, 244, 66, 255), 5, 1, emptyTiles1); Node[,] chunk5 = LevelEditor_2.createChunk(demoMap, new Color32(66, 244, 66, 255), 5, 1, emptyTiles1); // Node[,] chunk6 = LevelEditor_2.createChunk(demoMap, new Color32(66, 244, 155, 255), 5, 1, emptyTiles1); Node[,] chunk7 = LevelEditor_2.createChunk(demoMap, new Color32(66, 244, 244, 255), 5, 1, emptyTiles1); // Node[,] chunk8 = LevelEditor_2.createChunk(demoMap, new Color32(66, 155, 244, 255), 5, 1, emptyTiles1); Node[,] chunk9 = LevelEditor_2.createChunk(demoMap, new Color32(66, 66, 244, 255), 5, 1, emptyTiles1); // Node[,] chunk10 = LevelEditor_2.createChunk(demoMap, new Color32(155, 66, 244, 255), 5, 1, emptyTiles1); Node[,] chunk11 = LevelEditor_2.createChunk(demoMap, new Color32(244, 66, 244, 255), 5, 1); // Node[,] chunk12 = LevelEditor_2.createChunk(demoMap, new Color32(244, 244, 244, 255), 1, 4); LevelEditor_2.createTwoWayLink( chunk1, chunk12, new LevelEditor_2.TileCoord(2, 0), new LevelEditor_2.TileCoord(0, 0), LevelEditor_2.Direction.South ); LevelEditor_2.createTwoWayLink( chunk11, chunk12, new LevelEditor_2.TileCoord(2, 0), new LevelEditor_2.TileCoord(0, 3), LevelEditor_2.Direction.North ); #region links_1 #region 1-2 LevelEditor_2.createTwoWayLink( chunk1, chunk2, new LevelEditor_2.TileCoord(0, 0), new LevelEditor_2.TileCoord(0, 0), LevelEditor_2.Direction.South ); LevelEditor_2.createTwoWayLink( chunk1, chunk2, new LevelEditor_2.TileCoord(1, 0), new LevelEditor_2.TileCoord(1, 0), LevelEditor_2.Direction.South ); LevelEditor_2.createTwoWayLink( chunk1, chunk2, new LevelEditor_2.TileCoord(3, 0), new LevelEditor_2.TileCoord(3, 0), LevelEditor_2.Direction.South ); LevelEditor_2.createTwoWayLink( chunk1, chunk2, new LevelEditor_2.TileCoord(4, 0), new LevelEditor_2.TileCoord(4, 0), LevelEditor_2.Direction.South ); #endregion #region 2-3 LevelEditor_2.createTwoWayLink( chunk2, chunk3, new LevelEditor_2.TileCoord(0, 0), new LevelEditor_2.TileCoord(0, 0), LevelEditor_2.Direction.South ); LevelEditor_2.createTwoWayLink( chunk2, chunk3, new LevelEditor_2.TileCoord(1, 0), new LevelEditor_2.TileCoord(1, 0), LevelEditor_2.Direction.South ); LevelEditor_2.createTwoWayLink( chunk2, chunk3, new LevelEditor_2.TileCoord(3, 0), new LevelEditor_2.TileCoord(3, 0), LevelEditor_2.Direction.South ); LevelEditor_2.createTwoWayLink( chunk2, chunk3, new LevelEditor_2.TileCoord(4, 0), new LevelEditor_2.TileCoord(4, 0), LevelEditor_2.Direction.South ); #endregion #region 3-4 LevelEditor_2.createTwoWayLink( chunk3, chunk4, new LevelEditor_2.TileCoord(0, 0), new LevelEditor_2.TileCoord(0, 0), LevelEditor_2.Direction.South ); LevelEditor_2.createTwoWayLink( chunk3, chunk4, new LevelEditor_2.TileCoord(1, 0), new LevelEditor_2.TileCoord(1, 0), LevelEditor_2.Direction.South ); LevelEditor_2.createTwoWayLink( chunk3, chunk4, new LevelEditor_2.TileCoord(3, 0), new LevelEditor_2.TileCoord(3, 0), LevelEditor_2.Direction.South ); LevelEditor_2.createTwoWayLink( chunk3, chunk4, new LevelEditor_2.TileCoord(4, 0), new LevelEditor_2.TileCoord(4, 0), LevelEditor_2.Direction.South ); #endregion #region 4-5 LevelEditor_2.createTwoWayLink( chunk4, chunk5, new LevelEditor_2.TileCoord(0, 0), new LevelEditor_2.TileCoord(0, 0), LevelEditor_2.Direction.South ); LevelEditor_2.createTwoWayLink( chunk4, chunk5, new LevelEditor_2.TileCoord(1, 0), new LevelEditor_2.TileCoord(1, 0), LevelEditor_2.Direction.South ); LevelEditor_2.createTwoWayLink( chunk4, chunk5, new LevelEditor_2.TileCoord(3, 0), new LevelEditor_2.TileCoord(3, 0), LevelEditor_2.Direction.South ); LevelEditor_2.createTwoWayLink( chunk4, chunk5, new LevelEditor_2.TileCoord(4, 0), new LevelEditor_2.TileCoord(4, 0), LevelEditor_2.Direction.South ); #endregion #region 5-6 LevelEditor_2.createTwoWayLink( chunk5, chunk6, new LevelEditor_2.TileCoord(0, 0), new LevelEditor_2.TileCoord(0, 0), LevelEditor_2.Direction.South ); LevelEditor_2.createTwoWayLink( chunk5, chunk6, new LevelEditor_2.TileCoord(1, 0), new LevelEditor_2.TileCoord(1, 0), LevelEditor_2.Direction.South ); LevelEditor_2.createTwoWayLink( chunk5, chunk6, new LevelEditor_2.TileCoord(3, 0), new LevelEditor_2.TileCoord(3, 0), LevelEditor_2.Direction.South ); LevelEditor_2.createTwoWayLink( chunk5, chunk6, new LevelEditor_2.TileCoord(4, 0), new LevelEditor_2.TileCoord(4, 0), LevelEditor_2.Direction.South ); #endregion #region 6-7 LevelEditor_2.createTwoWayLink( chunk6, chunk7, new LevelEditor_2.TileCoord(0, 0), new LevelEditor_2.TileCoord(0, 0), LevelEditor_2.Direction.South ); LevelEditor_2.createTwoWayLink( chunk6, chunk7, new LevelEditor_2.TileCoord(1, 0), new LevelEditor_2.TileCoord(1, 0), LevelEditor_2.Direction.South ); LevelEditor_2.createTwoWayLink( chunk6, chunk7, new LevelEditor_2.TileCoord(3, 0), new LevelEditor_2.TileCoord(3, 0), LevelEditor_2.Direction.South ); LevelEditor_2.createTwoWayLink( chunk6, chunk7, new LevelEditor_2.TileCoord(4, 0), new LevelEditor_2.TileCoord(4, 0), LevelEditor_2.Direction.South ); #endregion #region 7-8 LevelEditor_2.createTwoWayLink( chunk7, chunk8, new LevelEditor_2.TileCoord(0, 0), new LevelEditor_2.TileCoord(0, 0), LevelEditor_2.Direction.South ); LevelEditor_2.createTwoWayLink( chunk7, chunk8, new LevelEditor_2.TileCoord(1, 0), new LevelEditor_2.TileCoord(1, 0), LevelEditor_2.Direction.South ); LevelEditor_2.createTwoWayLink( chunk7, chunk8, new LevelEditor_2.TileCoord(3, 0), new LevelEditor_2.TileCoord(3, 0), LevelEditor_2.Direction.South ); LevelEditor_2.createTwoWayLink( chunk7, chunk8, new LevelEditor_2.TileCoord(4, 0), new LevelEditor_2.TileCoord(4, 0), LevelEditor_2.Direction.South ); #endregion #region 8-9 LevelEditor_2.createTwoWayLink( chunk8, chunk9, new LevelEditor_2.TileCoord(0, 0), new LevelEditor_2.TileCoord(0, 0), LevelEditor_2.Direction.South ); LevelEditor_2.createTwoWayLink( chunk8, chunk9, new LevelEditor_2.TileCoord(1, 0), new LevelEditor_2.TileCoord(1, 0), LevelEditor_2.Direction.South ); LevelEditor_2.createTwoWayLink( chunk8, chunk9, new LevelEditor_2.TileCoord(3, 0), new LevelEditor_2.TileCoord(3, 0), LevelEditor_2.Direction.South ); LevelEditor_2.createTwoWayLink( chunk8, chunk9, new LevelEditor_2.TileCoord(4, 0), new LevelEditor_2.TileCoord(4, 0), LevelEditor_2.Direction.South ); #endregion #region 9-10 LevelEditor_2.createTwoWayLink( chunk9, chunk10, new LevelEditor_2.TileCoord(0, 0), new LevelEditor_2.TileCoord(0, 0), LevelEditor_2.Direction.South ); LevelEditor_2.createTwoWayLink( chunk9, chunk10, new LevelEditor_2.TileCoord(1, 0), new LevelEditor_2.TileCoord(1, 0), LevelEditor_2.Direction.South ); LevelEditor_2.createTwoWayLink( chunk9, chunk10, new LevelEditor_2.TileCoord(3, 0), new LevelEditor_2.TileCoord(3, 0), LevelEditor_2.Direction.South ); LevelEditor_2.createTwoWayLink( chunk9, chunk10, new LevelEditor_2.TileCoord(4, 0), new LevelEditor_2.TileCoord(4, 0), LevelEditor_2.Direction.South ); #endregion #region 10-11 LevelEditor_2.createTwoWayLink( chunk10, chunk11, new LevelEditor_2.TileCoord(0, 0), new LevelEditor_2.TileCoord(0, 0), LevelEditor_2.Direction.South ); LevelEditor_2.createTwoWayLink( chunk10, chunk11, new LevelEditor_2.TileCoord(1, 0), new LevelEditor_2.TileCoord(1, 0), LevelEditor_2.Direction.South ); LevelEditor_2.createTwoWayLink( chunk10, chunk11, new LevelEditor_2.TileCoord(3, 0), new LevelEditor_2.TileCoord(3, 0), LevelEditor_2.Direction.South ); LevelEditor_2.createTwoWayLink( chunk10, chunk11, new LevelEditor_2.TileCoord(4, 0), new LevelEditor_2.TileCoord(4, 0), LevelEditor_2.Direction.South ); #endregion #endregion #region links_2 #region 3 LevelEditor_2.createTwoWayLink( chunk3, chunk12, new LevelEditor_2.TileCoord(1, 0), new LevelEditor_2.TileCoord(0, 0), LevelEditor_2.Direction.East ); LevelEditor_2.createTwoWayLink( chunk3, chunk12, new LevelEditor_2.TileCoord(3, 0), new LevelEditor_2.TileCoord(0, 0), LevelEditor_2.Direction.West ); #endregion #region 5 LevelEditor_2.createTwoWayLink( chunk5, chunk12, new LevelEditor_2.TileCoord(1, 0), new LevelEditor_2.TileCoord(0, 1), LevelEditor_2.Direction.East ); LevelEditor_2.createTwoWayLink( chunk5, chunk12, new LevelEditor_2.TileCoord(3, 0), new LevelEditor_2.TileCoord(0, 1), LevelEditor_2.Direction.West ); #endregion #region 7 LevelEditor_2.createTwoWayLink( chunk7, chunk12, new LevelEditor_2.TileCoord(1, 0), new LevelEditor_2.TileCoord(0, 2), LevelEditor_2.Direction.East ); LevelEditor_2.createTwoWayLink( chunk7, chunk12, new LevelEditor_2.TileCoord(3, 0), new LevelEditor_2.TileCoord(0, 2), LevelEditor_2.Direction.West ); #endregion #region 9 LevelEditor_2.createTwoWayLink( chunk9, chunk12, new LevelEditor_2.TileCoord(1, 0), new LevelEditor_2.TileCoord(0, 3), LevelEditor_2.Direction.East ); LevelEditor_2.createTwoWayLink( chunk9, chunk12, new LevelEditor_2.TileCoord(3, 0), new LevelEditor_2.TileCoord(0, 3), LevelEditor_2.Direction.West ); #endregion #endregion LevelEditor_2.setSource(chunk1, new LevelEditor_2.TileCoord(2, 0)); LevelEditor_2.setTarget(chunk11, new LevelEditor_2.TileCoord(2, 0)); return(demoMap); }
override public LevelMap generateRoom() { LevelMap _map = new LevelMap(); //This Room will show the player that they can move from one pink tile to the next List <LevelEditor_2.TileCoord> Chunk1EmptyTiles = new List <LevelEditor_2.TileCoord> { new LevelEditor_2.TileCoord(3, 1), new LevelEditor_2.TileCoord(3, 2), new LevelEditor_2.TileCoord(3, 3), new LevelEditor_2.TileCoord(3, 4), new LevelEditor_2.TileCoord(3, 5), new LevelEditor_2.TileCoord(3, 6), }; Node[,] chunk1 = LevelEditor_2.createChunk(_map, new Color32(244, 173, 66, 255), 4, 9, Chunk1EmptyTiles); Node[,] chunk2 = LevelEditor_2.createChunk(_map, Color.cyan, 2, 4); Node[,] chunk3 = LevelEditor_2.createChunk(_map, Color.red, 2, 4); LevelEditor_2.createTwoWayLink( chunk1, chunk2, new LevelEditor_2.TileCoord(3, 7), new LevelEditor_2.TileCoord(0, 2), GameManager.Direction.East ); LevelEditor_2.createTwoWayLink( chunk1, chunk2, new LevelEditor_2.TileCoord(3, 8), new LevelEditor_2.TileCoord(0, 3), GameManager.Direction.East ); LevelEditor_2.createTwoWayLink( chunk1, chunk3, new LevelEditor_2.TileCoord(3, 0), new LevelEditor_2.TileCoord(0, 0), GameManager.Direction.East ); LevelEditor_2.createOneWayLink( chunk2, chunk1, new LevelEditor_2.TileCoord(0, 0), new LevelEditor_2.TileCoord(3, 0), GameManager.Direction.West ); LevelEditor_2.createOneWayLink( chunk3, chunk1, new LevelEditor_2.TileCoord(0, 2), new LevelEditor_2.TileCoord(3, 7), GameManager.Direction.West ); LevelEditor_2.createOneWayLink( chunk3, chunk1, new LevelEditor_2.TileCoord(0, 3), new LevelEditor_2.TileCoord(3, 8), GameManager.Direction.West ); LevelEditor_2.setSource(_map, chunk1, new LevelEditor_2.TileCoord(2, 6)); LevelEditor_2.setTarget(_map, chunk3, new LevelEditor_2.TileCoord(1, 1)); return(_map); }
public static Map generateRoom() { Map demoMap = new Map(); //Demo room map, relativly complex List <LevelEditor_2.TileCoord> emptyTiles1 = new List <LevelEditor_2.TileCoord>(); emptyTiles1.Add(new LevelEditor_2.TileCoord(0, 0)); emptyTiles1.Add(new LevelEditor_2.TileCoord(2, 0)); emptyTiles1.Add(new LevelEditor_2.TileCoord(1, 2)); Node[,] chunk1 = LevelEditor_2.createChunk(demoMap, new Color32(255, 200, 100, 255), 3, 4, emptyTiles1); Node[,] chunk2 = LevelEditor_2.createChunk(demoMap, new Color32(100, 100, 255, 255), 3, 4, emptyTiles1); LevelEditor_2.createOneWayLink( chunk1, chunk2, new LevelEditor_2.TileCoord(0, 3), new LevelEditor_2.TileCoord(1, 3), LevelEditor_2.Direction.East ); LevelEditor_2.createOneWayLink( chunk2, chunk1, new LevelEditor_2.TileCoord(2, 3), new LevelEditor_2.TileCoord(1, 3), LevelEditor_2.Direction.West ); List <LevelEditor_2.TileCoord> emptyTiles2 = new List <LevelEditor_2.TileCoord>(); emptyTiles2.Add(new LevelEditor_2.TileCoord(1, 1)); Node[,] chunk3 = LevelEditor_2.createChunk(demoMap, new Color32(255, 0, 0, 255), 3, 3, emptyTiles2); Node[,] chunk4 = LevelEditor_2.createChunk(demoMap, new Color32(0, 255, 0, 255), 2, 1); Node[,] chunk5 = LevelEditor_2.createChunk(demoMap, new Color32(0, 0, 255, 255), 1, 2); LevelEditor_2.createTwoWayLink( chunk3, chunk4, new LevelEditor_2.TileCoord(0, 1), new LevelEditor_2.TileCoord(0, 0), LevelEditor_2.Direction.East ); LevelEditor_2.createTwoWayLink( chunk3, chunk4, new LevelEditor_2.TileCoord(2, 1), new LevelEditor_2.TileCoord(1, 0), LevelEditor_2.Direction.West ); LevelEditor_2.createTwoWayLink( chunk3, chunk5, new LevelEditor_2.TileCoord(1, 0), new LevelEditor_2.TileCoord(0, 0), LevelEditor_2.Direction.South ); LevelEditor_2.createTwoWayLink( chunk3, chunk5, new LevelEditor_2.TileCoord(1, 2), new LevelEditor_2.TileCoord(0, 1), LevelEditor_2.Direction.North ); LevelEditor_2.createTwoWayLink( chunk1, chunk3, new LevelEditor_2.TileCoord(1, 0), new LevelEditor_2.TileCoord(1, 2), LevelEditor_2.Direction.North ); Node[,] chunk6 = LevelEditor_2.createChunk(demoMap, new Color32(50, 50, 50, 255), 1, 1); LevelEditor_2.createTwoWayLink( chunk3, chunk6, new LevelEditor_2.TileCoord(0, 0), new LevelEditor_2.TileCoord(0, 0), LevelEditor_2.Direction.West ); LevelEditor_2.setSource(chunk2, new LevelEditor_2.TileCoord(1, 0)); LevelEditor_2.setTarget(chunk6, new LevelEditor_2.TileCoord(0, 0)); return(demoMap); }
public static Map generateRoom() { Map demoMap = new Map(); // This map is a long room, with a walled off walway in the middle. // The hallway looks short from the outside, and long from the inside List <LevelEditor_2.TileCoord> emptyTiles = new List <LevelEditor_2.TileCoord> { new LevelEditor_2.TileCoord(1, 1), new LevelEditor_2.TileCoord(5, 1), new LevelEditor_2.TileCoord(5, 4), new LevelEditor_2.TileCoord(3, 4), new LevelEditor_2.TileCoord(1, 4), new LevelEditor_2.TileCoord(3, 1), }; Node[,] chunk1 = LevelEditor_2.createChunk(demoMap, new Color32(255, 255, 0, 255), 7, 6, emptyTiles); Node[,] chunkAE = LevelEditor_2.createChunk(demoMap, Color.red, 1, 3); Node[,] chunkBF = LevelEditor_2.createChunk(demoMap, Color.green, 1, 3); Node[,] chunkCD = LevelEditor_2.createChunk(demoMap, Color.blue, 1, 3); LevelEditor_2.createTwoWayLink( chunk1, chunkAE, new LevelEditor_2.TileCoord(1, 2), new LevelEditor_2.TileCoord(0, 2), LevelEditor_2.Direction.North ); LevelEditor_2.createTwoWayLink( chunk1, chunkAE, new LevelEditor_2.TileCoord(3, 3), new LevelEditor_2.TileCoord(0, 0), LevelEditor_2.Direction.South ); LevelEditor_2.createTwoWayLink( chunk1, chunkBF, new LevelEditor_2.TileCoord(3, 2), new LevelEditor_2.TileCoord(0, 2), LevelEditor_2.Direction.North ); LevelEditor_2.createTwoWayLink( chunk1, chunkBF, new LevelEditor_2.TileCoord(5, 3), new LevelEditor_2.TileCoord(0, 0), LevelEditor_2.Direction.South ); LevelEditor_2.createTwoWayLink( chunk1, chunkCD, new LevelEditor_2.TileCoord(5, 2), new LevelEditor_2.TileCoord(0, 2), LevelEditor_2.Direction.North ); LevelEditor_2.createTwoWayLink( chunk1, chunkCD, new LevelEditor_2.TileCoord(1, 3), new LevelEditor_2.TileCoord(0, 0), LevelEditor_2.Direction.South ); LevelEditor_2.setSource(chunk1, new LevelEditor_2.TileCoord(0, 2)); LevelEditor_2.setTarget(chunk1, new LevelEditor_2.TileCoord(3, 3)); return(demoMap); }