示例#1
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch        = new SpriteBatch(GraphicsDevice);
            mainMenuButtons    = new Texture2D[3];
            map                = Cell.Parse("1.txt");
            cam                = new Camera(map);
            mainMenuButtons[0] = Content.Load <Texture2D>("PlayButton");
            mainMenuButtons[1] = Content.Load <Texture2D>("OptsButton");

            cellT = Content.Load <Texture2D>("Cell");

            font = Content.Load <SpriteFont>("SpriteFont1");

            towersText    = new Texture2D[10];
            towersText[0] = Content.Load <Texture2D>("Tower");

            uiTextures    = new Texture2D[10];
            uiTextures[0] = Content.Load <Texture2D>("planUI");
            mainMenu      = new IMenu(GameState.MainMenu);
            mainMenu.AddButton("Play", font, mainMenuButtons[0], GameState.LoadingMenu);
            mainMenu.AddButton("Options", font, mainMenuButtons[1], GameState.Options);
            mainMenu.AddButton("Quit", font, mainMenuButtons[0], GameState.Quit, Color.Yellow);

            inGameMenu = new IMenu(GameState.InGameMenu);
            inGameMenu.AddButton("Play", font, mainMenuButtons[0], GameState.InGame);
            inGameMenu.AddButton("Main Menu", font, mainMenuButtons[1], GameState.MainMenu);

            clippedToMouse = new Tower(Point.Zero, Tower.Types.type1, towersText[0]);

            currentMenu = mainMenu;
            gameUi      = new InGameUI(uiTextures);
        }
示例#2
0
 static public Cell[,] cleanMap(Cell[,] map)
 {
     for (int i = 0; i < map.GetLength(0); i++)
     {
         for (int j = 0; j < map.GetLength(1); j++)
         {
             map = Cell.Parse("1.txt");
         }
     }
     return(map);
 }