예제 #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()
        {
            spriteBatch = new SpriteBatch(GraphicsDevice);

            Texture2D grass        = Content.Load <Texture2D>("grass");
            Texture2D path         = Content.Load <Texture2D>("dirt");
            Texture2D bar          = Content.Load <Texture2D>("bar");
            Texture2D arrowNormal  = Content.Load <Texture2D>("tower");
            Texture2D arrowHover   = Content.Load <Texture2D>("towerhover");
            Texture2D arrowPressed = Content.Load <Texture2D>("towerpressed");


            arrowButton          = new Button(arrowNormal, arrowHover, arrowPressed, new Vector2(0, level.Height * 32 + 2));
            arrowButton.Clicked += new EventHandler(arrowButton_Clicked);



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

            level.AddTexture(grass);
            level.AddTexture(path);

            Texture2D enemyTexture = Content.Load <Texture2D>("nerd");

            toolBar = new Toolbar(bar, font, new Vector2(0, level.Height * 32));
            //enemy1 = new Enemy(enemyTexture, Vector2.Zero, 100, 10, 0.5f);
            // enemy1.SetWaypoints(level.Waypoints);
            // wave = new Wave(0, 10, level, enemyTexture);
            // wave.start();

            Texture2D towerTexture  = Content.Load <Texture2D>("tower_normal");
            Texture2D bulletTexture = Content.Load <Texture2D>("bullet");
            Texture2D healthBar     = Content.Load <Texture2D>("healthbar");

            player      = new Player(level, towerTexture, bulletTexture);
            waveManager = new WaveManager(player, level, 24, enemyTexture, healthBar);

            //tower = new Tower(towerTexture, Vector2.Zero);
        }
예제 #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()
        {
            spriteBatch = new SpriteBatch(GraphicsDevice);

            Texture2D grass = Content.Load<Texture2D>("grass");
            Texture2D path = Content.Load<Texture2D>("dirt");
            Texture2D bar = Content.Load<Texture2D>("bar");
            Texture2D arrowNormal = Content.Load<Texture2D>("tower");
            Texture2D arrowHover = Content.Load<Texture2D>("towerhover");
            Texture2D arrowPressed = Content.Load<Texture2D>("towerpressed");

            arrowButton = new Button(arrowNormal, arrowHover, arrowPressed, new Vector2(0, level.Height * 32 + 2));
            arrowButton.Clicked += new EventHandler(arrowButton_Clicked);

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

            level.AddTexture(grass);
            level.AddTexture(path);

            Texture2D enemyTexture = Content.Load<Texture2D>("nerd");

            toolBar = new Toolbar(bar, font, new Vector2(0, level.Height * 32));
            //enemy1 = new Enemy(enemyTexture, Vector2.Zero, 100, 10, 0.5f);
               // enemy1.SetWaypoints(level.Waypoints);
               // wave = new Wave(0, 10, level, enemyTexture);
               // wave.start();

            Texture2D towerTexture = Content.Load<Texture2D>("tower_normal");
            Texture2D bulletTexture = Content.Load<Texture2D>("bullet");
            Texture2D healthBar = Content.Load<Texture2D>("healthbar");

            player = new Player(level, towerTexture, bulletTexture);
            waveManager = new WaveManager(player, level, 24, enemyTexture, healthBar);

            //tower = new Tower(towerTexture, Vector2.Zero);
        }