Beispiel #1
0
        protected override void LoadContent()
        {
            spriteBatch = new SpriteBatch(GraphicsDevice);

            Texture2D grass = Content.Load<Texture2D>("grass");
            Texture2D path = Content.Load<Texture2D>("path");

            level.AddTexture(grass);
            level.AddTexture(path);
            Texture2D enemyTexture = Content.Load<Texture2D>("enemy");

            /*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");
            tower = new Tower(towerTexture, Vector2.Zero);
            player = new Player(level, towerTexture);*/

            Texture2D towerTexture = Content.Load<Texture2D>("tower");
            Texture2D bulletTexture = Content.Load<Texture2D>("bullet");
            player = new Player(level, towerTexture, bulletTexture);
            waveManager = new WaveManager(player, level, 30, enemyTexture);
            Texture2D topBar = Content.Load<Texture2D>("toolbar");
            SpriteFont font = Content.Load<SpriteFont>("Arial");
            toolbar = new Toolbar(topBar, font, new Vector2(0, level.Height * 32));

            Texture2D arrowNormal = Content.Load<Texture2D>("GUI\\Arrow Tower\\arrow normal");
            Texture2D arrowHover = Content.Load<Texture2D>("GUI\\Arrow Tower\\arrow hover");
            Texture2D arrowPressed = Content.Load<Texture2D>("GUI\\Arrow Tower\\arrow pressed");

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