public OverWorld(TileMap owm, int x, int y, Game1 g)
 {
     OWmap = owm;
       Xpos = x;
       Ypos = y;
       Facing = 2;
       EntityList = new List<Entity>();
       Game_Ref = g;
       mapList = new List<TileMap>();
       mapList.Add(OWmap);
 }
 public OverWorld(int[,] existingMap, int[,] existingCollisionMap, int x, int y, Game1 g)
 {
     OWmap = new TileMap(existingMap, existingCollisionMap);
       Xpos = x;
       Ypos = y;
       Facing = 2;
       EntityList = new List<Entity>();
       Game_Ref = g;
       mapList = new List<TileMap>();
       mapList.Add(OWmap);
 }
Exemple #3
0
 public Combat(ContentManager content, int height, int width, Game1 game, Player[] p, Enemy[] e)
 {
     _content = content;
       _height = height;
       _width = width;
       maingame = game;
       random = new Random();
       highestMenuOption = 1;
       lowestMenuOption = 3;
       menuLayer = 0;
       menuoption = (int)MenuOption.Fight;
       prevKeyboardState = Keyboard.GetState();
       currentKeyboardState = Keyboard.GetState();
       thePlayers = p;
       theEnemies = e;
       messageQueue = new Queue<string>();
       AddMessage("Player Turn");
       ranAway = false;
 }
 public static OverWorld getMap(String input, Game1 g)
 {
     switch (input)
       {
     case "test":
       return getMap(1, g);
     case "grassy":
       return getMap(2, g);
     case "dungeon1":
       return getMap(3, g);
     default:
       //Console.WriteLine("Tried to get a bad map.");
       return null;
       }
 }
        public static OverWorld getMap(int index, Game1 g)
        {
            switch (index)
              {
            case 1: // initial test overworld
              return new OverWorld(new int[,]
                       {
                         {1,0,0,0,3,0,3,0},
                         {0,2,0,0,0,0,1,0},
                         {1,0,0,2,0,0,0,0},
                         {0,0,0,0,0,0,0,0},
                         {1,0,4,0,0,0,4,0},
                         {0,0,0,0,0,0,3,0}
                       },
                  new int[,]
                       {
                         {1,0,0,0,0,0,0,0},
                         {0,0,0,0,0,0,0,0},
                         {1,0,0,0,0,0,0,0},
                         {0,0,0,0,0,0,0,0},
                         {1,0,0,0,0,0,0,0},
                         {0,0,0,0,0,0,0,0}
                       }, 2, 2, g);
            case 2: // only grass
              return new OverWorld(new int[,]
                       {
                         {0,0,0,0,0,0,0,0},
                         {0,0,0,0,0,0,0,0},
                         {0,0,0,0,0,0,0,0},
                         {0,0,0,0,0,0,0,0},
                         {0,0,0,0,0,0,0,0},
                         {0,0,0,0,0,0,0,0}
                       },
                  new int[,]
                       {
                         {0,0,0,0,0,0,0,0},
                         {0,0,0,0,0,0,0,0},
                         {0,0,0,0,0,0,0,0},
                         {0,0,0,0,0,0,0,0},
                         {0,0,0,0,0,0,0,0},
                         {0,0,0,0,0,0,0,0}
                       }, 2, 2, g);
            case 3: // dungeon room
              return new OverWorld(new int[,]
                       {
                         {5,5,5,5,5,5,5,5},
                         {5,9,9,9,9,9,9,5},
                         {9,9,9,9,9,9,9,5},
                         {5,9,9,9,9,9,9,5},
                         {5,9,9,9,9,9,9,5},
                         {5,5,5,5,5,5,5,5}
                       },
                  new int[,]
                       {
                         {1,1,1,1,1,1,1,1},
                         {1,0,0,0,0,0,0,1},
                         {0,0,0,0,0,0,0,0},
                         {1,0,0,0,0,0,0,1},
                         {1,0,0,0,0,0,0,1},
                         {1,1,1,1,1,1,1,1}
                       }, 2, 0, g);
            case 4: // big dungeon room
              return new OverWorld(new int[,]
                       {
                         {5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5},
                         {1,6,6,6,6,6,6,6,6,6,6,6,6,6,6,5},
                         {5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,5},
                         {5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,5},
                         {5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,5},
                         {5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,5},
                         {5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,5},
                         {5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,5},
                         {5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,5},
                         {5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,5},
                         {5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,1},
                         {5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5}
                       },
                  new int[,]
                       {
                         {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},
                         {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
                         {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
                         {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
                         {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
                         {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
                         {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
                         {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
                         {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
                         {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
                         {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
                         {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}
                       }, 1, 1, g);
            case 5:
              return new OverWorld(new int[,]
                       {
                         {5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5},
                         {5,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},
                         {5,1,1,1,1,1,1,1,1,1,1,1,1,1,1,5},
                         {5,1,1,1,1,1,1,1,1,1,1,1,1,1,1,5},
                         {5,1,1,1,1,1,1,1,1,1,1,1,1,1,1,5},
                         {5,1,1,1,1,1,1,1,1,1,1,1,1,1,1,5},
                         {5,1,1,1,1,1,1,1,1,1,1,1,1,1,1,5},
                         {5,1,1,1,1,1,1,1,1,1,1,1,1,1,1,5},
                         {5,1,1,1,1,1,1,1,1,1,1,1,1,1,1,5},
                         {5,1,1,1,1,1,1,1,1,1,1,1,1,1,1,5},
                         {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,5},
                         {5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5}
                       },
                  new int[,]
                       {
                         {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},
                         {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
                         {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
                         {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
                         {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
                         {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
                         {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
                         {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
                         {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
                         {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
                         {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
                         {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}
                       },10,0,g);

            case 6:
              return new OverWorld(new int[,]
                       {
                         {5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5},
                         {1,7,7,7,7,7,7,7,7,7,7,7,7,7,7,1},//door here
                         {5,7,7,7,7,7,7,7,7,7,7,7,7,7,7,5},
                         {5,7,7,7,7,7,7,7,7,7,7,7,7,7,7,5},
                         {5,7,7,7,7,7,7,7,7,7,7,7,7,7,7,5},
                         {5,7,7,7,7,7,7,7,7,7,7,7,7,7,7,5},
                         {5,7,7,7,7,7,7,7,7,7,7,7,7,7,7,5},
                         {5,7,7,7,7,7,7,7,7,7,7,7,7,7,7,5},
                         {5,7,7,7,7,7,7,7,7,7,7,7,7,7,7,5},
                         {5,7,7,7,7,7,7,7,7,7,7,7,7,7,7,5},
                         {5,7,7,7,7,7,7,7,7,7,7,7,7,7,7,1},//door here
                         {5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5}
                       },
                  new int[,]
                       {
                         {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},
                         {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
                         {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
                         {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
                         {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
                         {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
                         {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
                         {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
                         {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
                         {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
                         {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
                         {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}
                       }, 10, 0, g);

            case 7:
              return new OverWorld(new int[,]
                       {
                         {5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5},
                         {1,8,8,8,8,8,8,8,8,8,8,8,8,8,8,5},//door here
                         {5,8,8,8,8,8,8,8,8,8,8,8,8,8,8,5},
                         {5,8,8,8,8,8,8,8,8,8,8,8,8,8,8,5},
                         {5,8,8,8,8,8,8,8,8,8,8,8,8,8,8,5},
                         {5,8,8,8,8,8,8,8,8,8,8,8,8,8,8,5},
                         {5,8,8,8,8,8,8,8,8,8,8,8,8,8,8,1},//door here
                         {5,8,8,8,8,8,8,8,8,8,8,8,8,8,8,5},
                         {5,8,8,8,8,8,8,8,8,8,8,8,8,8,8,5},
                         {5,8,8,8,8,8,8,8,8,8,8,8,8,8,8,5},
                         {5,8,8,8,8,8,8,8,8,8,8,8,8,8,8,5},
                         {5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5}
                       },
                  new int[,]
                       {
                         {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},
                         {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
                         {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
                         {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
                         {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
                         {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
                         {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
                         {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
                         {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
                         {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
                         {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
                         {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}
                       }, 10, 0, g);

            case 8:
              return new OverWorld(new int[,]
                       {
                         {5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5},
                         {1,8,8,8,8,8,8,8,8,8,8,8,8,8,8,5},//door here
                         {5,8,8,8,8,8,8,8,8,8,8,8,8,8,8,5},
                         {5,8,8,8,8,8,8,8,8,8,8,8,8,8,8,5},
                         {5,8,8,8,8,8,8,8,8,8,8,8,8,8,8,5},
                         {5,8,8,8,8,8,8,8,8,8,8,8,8,8,8,5},
                         {5,8,8,8,8,8,8,8,8,8,8,8,8,8,8,1},//door here
                         {5,8,8,8,8,8,8,8,8,8,8,8,8,8,8,5},
                         {5,8,8,8,8,8,8,8,8,8,8,8,8,8,8,5},
                         {5,8,8,8,8,8,8,8,8,8,8,8,8,8,8,5},
                         {5,8,8,8,8,8,8,8,8,8,8,8,8,8,8,5},
                         {5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5}
                       },
                  new int[,]
                       {
                         {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},
                         {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
                         {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
                         {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
                         {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
                         {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
                         {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
                         {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
                         {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
                         {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
                         {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
                         {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}
                       }, 10, 0, g);

            default:
              //Console.WriteLine("Tried to get a bad map.");
              return null;
              }
        }