public void Render(Position pos, Dungeon map)
 {
     if (rng.Next (20) == 0) {
                         var end = (GameObject)Object.Instantiate (c);
                         end.transform.position = map.Scaled (pos.Vector3 + new Vector3 (0f, 0.3f, 0f));
                 }
 }
 public void Render(Position pos, Dungeon map)
 {
     GameObject doorPortal = (GameObject)Object.Instantiate(clonableRoomPortal);
     // walls
     if (!map.HasContent(pos + new Position (-1, 0, 0))) {
         doorPortal.transform.Rotate(0,180,0);
         doorPortal.transform.position = map.Scaled(pos.Vector3 + new Vector3 (-0.5f, 0, 0));
     }
     else if (!map.HasContent(pos + new Position (1, 0, 0))) {
         doorPortal.transform.Rotate(0,0,0);
         doorPortal.transform.position = map.Scaled(pos.Vector3 + new Vector3 (0.5f, 0, 0));
     }
     else if (!map.HasContent(pos + new Position (0, 0, -1))) {
         doorPortal.transform.Rotate(0,90,0);
         doorPortal.transform.position = map.Scaled(pos.Vector3 + new Vector3 (0, 0, -0.5f));
     }
     else if (!map.HasContent(pos + new Position (0, 0, 1))) {
         doorPortal.transform.Rotate(0,270,0);
         doorPortal.transform.position = map.Scaled(pos.Vector3 + new Vector3 (0, 0, 0.5f));
     }
 }
        public void DrawLevel()
        {
            d = new Dungeon ();

            var p = new Map (d, rng, levels[level]);

            p.buildMap ();

            d.RenderAll ();

            GameObject.FindGameObjectWithTag ("Player").transform.position = d.Scaled(new Vector3(2f, 20f, 2f));
        }
 public void Render(Position pos, Dungeon map)
 {
     torch = (GameObject)Object.Instantiate(clonableTorch);
     // walls
     if (!map.HasContent(pos + new Position (-1, 0, 0))) {
         torch.transform.Rotate(0,180,0);
         torch.transform.position = map.Scaled(pos.Vector3 + new Vector3 (-0.5f, 0, 0));
     }
     else if (!map.HasContent(pos + new Position (1, 0, 0))) {
         torch.transform.Rotate(0,0,0);
         torch.transform.position = map.Scaled(pos.Vector3 + new Vector3 (0.5f, 0, 0));
     }
     else if (!map.HasContent(pos + new Position (0, 0, -1))) {
         torch.transform.Rotate(0,90,0);
         torch.transform.position = map.Scaled(pos.Vector3 + new Vector3 (0, 0, -0.5f));
     }
     else if (!map.HasContent(pos + new Position (0, 0, 1))) {
         torch.transform.Rotate(0,270,0);
         torch.transform.position = map.Scaled(pos.Vector3 + new Vector3 (0, 0, 0.5f));
     }
     else {
         Object.Destroy(torch.gameObject);
     }
 }