Example #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.
            Map.map         = Map.Parse(currentMap);
            cellsWithTower  = new List <Cell>();
            spriteBatch     = new SpriteBatch(GraphicsDevice);
            mainMenuButtons = new Texture2D[3];
            towersText      = new Texture2D[10];
            uiTextures      = new Texture2D[10];

            cam          = new Camera();
            cam.position = new Vector2(0, Map.initialPathLocation.Y - GraphicsDeviceManager.DefaultBackBufferHeight / 2);

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

            creepText = Content.Load <Texture2D>("Creep");

            wave = new CreepWave(30);

            towerRange = Content.Load <Texture2D>("range");

            missileText = Content.Load <Texture2D>("Missile");

            mainMenuButtons[0] = Content.Load <Texture2D>("PlayButton");
            mainMenuButtons[1] = Content.Load <Texture2D>("OptsButton");

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

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

            uiTextures[0] = Content.Load <Texture2D>("UIParts/UI_Bottom");
            uiTextures[1] = Content.Load <Texture2D>("Icons/deleteIcon");
            uiTextures[2] = Content.Load <Texture2D>("Icons/addIcon");
            uiTextures[3] = Content.Load <Texture2D>("Icons/upgradeIcon");

            currentMenu  = new Menus.MainMenu();
            options      = new Menus.Options(graphics);
            gameUi       = new InGameUI(uiTextures, ref cellsWithTower);
            ingamemenu   = new Menus.InGameMenu(ref cam, ref cellsWithTower, currentMap);
            gameOverMenu = new Menus.GameOverMenu(ref cam, ref cellsWithTower, currentMap);

            clippedToMouse = new Tower(Point.Zero, Tower.Types.type1, towersText[0], 100, false);
        }
Example #2
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.
            Map.map = Map.Parse(currentMap);
            cellsWithTower = new List<Cell>();
            spriteBatch = new SpriteBatch(GraphicsDevice);
            mainMenuButtons = new Texture2D[3];
            towersText = new Texture2D[10];
            uiTextures = new Texture2D[10];

            cam = new Camera();
            cam.position = new Vector2(0, Map.initialPathLocation.Y - GraphicsDeviceManager.DefaultBackBufferHeight / 2);

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

            creepText = Content.Load<Texture2D>("Creep");

            wave = new CreepWave(30);

            towerRange = Content.Load<Texture2D>("range");

            missileText = Content.Load<Texture2D>("Missile");

            mainMenuButtons[0] = Content.Load<Texture2D>("PlayButton");
            mainMenuButtons[1] = Content.Load<Texture2D>("OptsButton");

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

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

            uiTextures[0] = Content.Load<Texture2D>("UIParts/UI_Bottom");
            uiTextures[1] = Content.Load<Texture2D>("Icons/deleteIcon");
            uiTextures[2] = Content.Load<Texture2D>("Icons/addIcon");
            uiTextures[3] = Content.Load<Texture2D>("Icons/upgradeIcon");

            currentMenu = new Menus.MainMenu();
            options = new Menus.Options(graphics);
            gameUi = new InGameUI(uiTextures, ref cellsWithTower);
            ingamemenu = new Menus.InGameMenu(ref cam, ref cellsWithTower, currentMap);
            gameOverMenu = new Menus.GameOverMenu(ref cam, ref cellsWithTower, currentMap);

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