public EndInterface(Interface iface, Controller player, WaveMgr waveManager, SpriteFont[] fonts, Texture2D[] RetryButtonTextures)
 {
     this.iface = iface;
     this.player = player;
     this.waveManager = waveManager;
     this.fonts = fonts;
     this.RetryButton = new Button(RetryButtonTextures[0], RetryButtonTextures[1], RetryButtonTextures[2], Vector2.Zero);
     this.RetryButton.OnMouseClick += new EventHandler(RetryButton_OnMouseClick);
     this.RetryButton.Enabled = false;
 }
Example #2
0
        protected override void LoadContent()
        {
            spriteBatch = new SpriteBatch(GraphicsDevice);
            map.LoadTextures(this);

            Texture2D[] towerTextures = new Texture2D[] {
                Content.Load<Texture2D>("Towers/ArrowTower"),
                Content.Load<Texture2D>("Towers/CannonTower"),
                Content.Load<Texture2D>("Towers/DualShot"),
                Content.Load<Texture2D>("Towers/SpikeTower")
            };

            Texture2D[] bulletTextures = new Texture2D[] {
                Content.Load<Texture2D>("Bullets/Arrow"),
                Content.Load<Texture2D>("Bullets/Cannonball"),
                Content.Load<Texture2D>("Bullets/WaterBullet"),
                Content.Load<Texture2D>("Bullets/Bullet")
            };

            player = new Controller(map, towerTextures, bulletTextures);

            Texture2D bluehealthbar = Content.Load<Texture2D>("HealthBar/BlueProgressbar");
            Texture2D greenhealthbar = Content.Load<Texture2D>("HealthBar/GreenProgressbar");
            Texture2D healthbarbackground = Content.Load<Texture2D>("HealthBar/ProgressbarBackground");

            //level, amount, speed, coins, hp, framecount, framedelay, framewidth, frameheight
            waveManager = new WaveMgr(map, new Wave[]{
                new Wave("Rats", greenhealthbar, healthbarbackground, Content.Load<Texture2D>("NPCs/Rat"), player, 1, 25, 1.0f, 1, 200, 4, 100.0f, 34, 32, map),
                new Wave("Scorpions", greenhealthbar, healthbarbackground, Content.Load<Texture2D>("NPCs/Scorpion"), player, 2, 25, 1.0f, 1, 42, 8, 100.0f, 31, 31, map),
                new Wave("Beetles", greenhealthbar, healthbarbackground, Content.Load<Texture2D>("NPCs/Beetle"), player, 3, 25, 1.0f, 1, 65, 3, 100.0f, 32, 32, map),
                new Wave("Chitiniacs", greenhealthbar, healthbarbackground, Content.Load<Texture2D>("NPCs/Chitiniac"), player, 4, 25, 1.0f, 1, 75, 8, 100.0f, 31, 31, map),
                new Wave("Cockroaches", greenhealthbar, healthbarbackground, Content.Load<Texture2D>("NPCs/Cockroach"), player, 5, 25, 1.0f, 1, 101, 8, 100.0f, 31, 31, map),

                new Wave("Bandits", greenhealthbar, healthbarbackground, Content.Load<Texture2D>("NPCs/Bandit"), player, 6, 25, 1.5f, 1, 87, 8, 100.0f, 31, 31, map),
                new Wave("Crawlers", greenhealthbar, healthbarbackground, Content.Load<Texture2D>("NPCs/Crawler"), player, 7, 25, 1.0f, 2, 136, 7, 100.0f, 36, 36, map),
                new Wave("Hornets", greenhealthbar, healthbarbackground, Content.Load<Texture2D>("NPCs/Hornet"), player, 8, 25, 1.0f, 1, 158, 8, 100.0f, 31, 31, map),
                new Wave("Ogres", greenhealthbar, healthbarbackground, Content.Load<Texture2D>("NPCs/Ogre"), player, 9, 25, 1.0f, 1, 189, 8, 100.0f, 31, 31, map),
                new Wave("PigKlivers", greenhealthbar, healthbarbackground,  Content.Load<Texture2D>("NPCs/PigKliver"), player, 10, 25, 1.0f, 2, 212, 8, 100.0f, 31, 31, map),

                new Wave("[BOSS] Mage", bluehealthbar, healthbarbackground, Content.Load<Texture2D>("NPCs/Mage"), player, 10, 1, 1.0f, 45, 2000, 8, 100.0f, 31, 31, map),
                new Wave("Trolls", greenhealthbar, healthbarbackground, Content.Load<Texture2D>("NPCs/Troll"), player, 11, 25, 1.0f, 2, 245, 8, 100.0f, 31, 31, map)
            });

            infoInterface = new Interface(player, Content.Load<Texture2D>("GUI/Toolbar"), Content.Load<Texture2D>("GUI/Toolbar"), Content.Load<SpriteFont>("Fonts/ToolbarFont"), Map.ToMapSpace(new Vector2(map.Width, 0)), Map.ToMapSpace(new Vector2(map.Width, 0)));
            infoInterface.SetCoinInfo(Content.Load<Texture2D>("GUI/Coin"), Map.ToMapSpace(new Vector2(map.Width, 0.1f)), 7, 32, 32, 100.0f);
            infoInterface.SetDummyTexture(new Texture2D(this.graphics.GraphicsDevice, 1, 1));

            Texture2D ButtonBackground = Content.Load<Texture2D>("GUI/ButtonBackground");
            Texture2D ButtonHoverBackground = Content.Load<Texture2D>("GUI/ButtonHoverBackground");
            Texture2D ButtonClickBackground = Content.Load<Texture2D>("GUI/ButtonClickBackground");

            Texture2D StartButtonBackground = Content.Load<Texture2D>("GUI/StartButtonBackground");
            Texture2D StartButtonHoverBackground = Content.Load<Texture2D>("GUI/StartButtonHoverBackground");
            Texture2D StartButtonClickBackground = Content.Load<Texture2D>("GUI/StartButtonClickBackground");
            infoInterface.SetTowerButtonBackgrounds(new Texture2D[] { ButtonBackground, ButtonClickBackground, ButtonHoverBackground }, towerTextures);
            infoInterface.SetStartButton(Content.Load<SpriteFont>("Fonts/StartButtonFont"), new Texture2D[] { StartButtonBackground, StartButtonClickBackground, StartButtonHoverBackground }, waveManager);
            infoInterface.SetTextboxFonts(Content.Load<SpriteFont>("Fonts/TextboxWelcomeFont"), Content.Load<SpriteFont>("Fonts/TextboxFont"));

            endInterface = new EndInterface(infoInterface, player, waveManager, new SpriteFont[] { Content.Load<SpriteFont>("Fonts/EndInterfaceTitle"), Content.Load<SpriteFont>("Fonts/EndInterfaceScoreTitle"), Content.Load<SpriteFont>("Fonts/EndInterfaceTitle"), Content.Load<SpriteFont>("Fonts/StartButtonFont") }, new Texture2D[] { StartButtonBackground, StartButtonClickBackground, StartButtonHoverBackground });
        }