예제 #1
0
        public static void Load()
        {
            background = Globals.Content.Load<Texture2D>("Map\\BG\\OtherLayer");
            foreground = Globals.Content.Load<Texture2D>("Map\\BG\\Planklayer");
            IngameMusic = Globals.Content.Load<Song>("Hillbilly Bill");

            lose = Globals.Content.Load<Texture2D>("GFX\\screens\\lose");
            win = Globals.Content.Load<Texture2D>("GFX\\screens\\win");
            startscherm = Globals.Content.Load<Texture2D>("GFX\\screens\\startscherm");

            MediaPlayer.Volume = 0.5f;

            MediaPlayer.Play(IngameMusic);
            MediaPlayer.IsRepeating = true;

            Texture2D life = Globals.Content.Load<Texture2D>("GUI\\Lifes\\HouseDecay");
            Texture2D grass = Globals.Content.Load<Texture2D>("GUI\\path");
            Texture2D pad = Globals.Content.Load<Texture2D>("pad");
            Texture2D Water = Globals.Content.Load<Texture2D>("GFX\\Tiles\\Waterp");

            Texture2D PadV = Globals.Content.Load<Texture2D>("GFX\\Tiles\\testp");
            Texture2D PadH = Globals.Content.Load<Texture2D>("GFX\\Tiles\\testp2");

            Texture2D lily1 = Globals.Content.Load<Texture2D>("GFX\\Tiles\\testb");
            Texture2D lily2 = Globals.Content.Load<Texture2D>("GFX\\Tiles\\testb2");

            Texture2D StatsWindow = Globals.Content.Load<Texture2D>("GUI\\Currency\\StatWindow3");
            Texture2D Enter2Play = Globals.Content.Load<Texture2D>("Enter");
            Texture2D Trapmenu = Globals.Content.Load<Texture2D>("GUI\\TrapMenu\\BuyTab3");

            Texture2D arrowNormal = Globals.Content.Load<Texture2D>("GUI\\Toren");
            Texture2D arrowHover = Globals.Content.Load<Texture2D>("GUI\\arrow_hover");
            Texture2D arrow_pressed = Globals.Content.Load<Texture2D>("GUI\\arrow_pressed");

            Texture2D gasTrap = Globals.Content.Load<Texture2D>("GFX\\Traps\\Trap_Poinsion_gas");
            Texture2D fenceTrap = Globals.Content.Load<Texture2D>("GFX\\Traps\\fence");
            Livedecay = Globals.Content.Load<Texture2D>("GUI\\Currency\\HouseDecay");
            Texture2D PsnNormal = Globals.Content.Load<Texture2D>("Traps\\spike tower");
            Texture2D PsnHover = Globals.Content.Load<Texture2D>("Traps\\spike hover");
            Texture2D PsnPressed = Globals.Content.Load<Texture2D>("Traps\\spike tower");
            FrogTex = Globals.Content.Load<Texture2D>("GFX\\Mobs\\Frog\\Frogspripfront");
            RacoonTex = Globals.Content.Load<Texture2D>("GFX\\Mobs\\Racoon\\RacoonStrip");
            BatTex = Globals.Content.Load<Texture2D>("GFX\\Mobs\\Bat\\Batstripfront_84bij122");
            SpriteFont font = Globals.Content.Load<SpriteFont>("Fonts\\Arial");

            MediaPlayer.Volume = 0.9f;

            Texture2D[] towertextures = new Texture2D[]
            {
                Globals.Content.Load<Texture2D>("GFX\\Traps\\Beartrap\\waffle_trap_strip"),
                Globals.Content.Load<Texture2D>("GFX\\Traps\\FenceTrap\\electricfence_sheet"),
                Globals.Content.Load<Texture2D>("GFX\\Traps\\FlyTrap\\fly_trap_168x256"),
                Globals.Content.Load<Texture2D>("GFX\\Traps\\Baseballbat\\baseball"),
            };

            player = new Player(level, towertextures);
            waveManager = new WaveManager(player,level, 25);
            waterWavemanager = new WaterWaveManager(player,level,25);
            toolbar = new Toolbar(StatsWindow, font, new Vector2(10,2));
            ElecFence = new Button(grass, grass, grass, new Vector2(940, 360), player, "BaseballBat");
            Flytrap = new Button(grass, grass, grass, new Vector2(940, 433), player, "Fly Trap");
            BearTrap = new Button(grass, grass, grass, new Vector2(940, 495), player, "Fence");
            BaseballBat = new Button(grass, grass, grass, new Vector2(940, 575), player, "Bear Trap");
            gamemanager = new GameManager(level,waterWavemanager, waveManager, Trapmenu);
            racoonmanager = new RacoonManager(level,RacoonTex,player);
        }
        public static void Load()
        {
            Texture2D grass = Globals.Content.Load<Texture2D>("grass");
            Texture2D pad = Globals.Content.Load<Texture2D>("pad");
            Texture2D Water = Globals.Content.Load<Texture2D>("GFX\\Tiles\\Waterp");

            Texture2D PadV = Globals.Content.Load<Texture2D>("GFX\\Tiles\\testp");
            Texture2D PadH = Globals.Content.Load<Texture2D>("GFX\\Tiles\\testp2");

            Texture2D lily1 = Globals.Content.Load<Texture2D>("GFX\\Tiles\\testb");
            Texture2D lily2 = Globals.Content.Load<Texture2D>("GFX\\Tiles\\testb2");

            Texture2D StatsWindow = Globals.Content.Load<Texture2D>("GUI\\Currency\\StatsWindow");
            Texture2D Enter2Play = Globals.Content.Load<Texture2D>("Enter");
            Texture2D Trapmenu = Globals.Content.Load<Texture2D>("GUI\\TrapMenu\\BuyTab");

            Texture2D arrowNormal = Globals.Content.Load<Texture2D>("GUI\\Toren");
            Texture2D arrowHover = Globals.Content.Load<Texture2D>("GUI\\arrow_hover");
            Texture2D arrow_pressed = Globals.Content.Load<Texture2D>("GUI\\arrow_pressed");

            Texture2D gasTrap = Globals.Content.Load<Texture2D>("GFX\\Traps\\Trap_Poinsion_gas");
            Texture2D fenceTrap = Globals.Content.Load<Texture2D>("GFX\\Traps\\fence");

            Texture2D PsnNormal = Globals.Content.Load<Texture2D>("Traps\\spike tower");
            Texture2D PsnHover = Globals.Content.Load<Texture2D>("Traps\\spike hover");
            Texture2D PsnPressed = Globals.Content.Load<Texture2D>("Traps\\spike tower");
            blatex = Globals.Content.Load<Texture2D>("grastiles");

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

            level.AddTexture(pad);
            level.AddTexture(Water);

            level.AddTexture(lily1);
            level.AddTexture(lily2);

            level.AddTexture(PadH);
            level.AddTexture(PadV);

            Texture2D[] towertextures = new Texture2D[]
            {
                Globals.Content.Load<Texture2D>("GFX\\Traps\\GasTrap\\gas1"),
                Globals.Content.Load<Texture2D>("GFX\\Traps\\Trap_Poinsion_gas")
            };

            Texture2D[] bullettextures = new Texture2D[]
            {
                Globals.Content.Load<Texture2D>("GFX\\Traps\\GasTrap\\G13")
            };

            TileTextures = new Texture2D[]
            {
                /*Globals.Content.Load<Texture2D>("GFX\\Tiles\\testb"),
                Globals.Content.Load<Texture2D>("GFX\\Tiles\\testb2"),
                Globals.Content.Load<Texture2D>("GFX\\Tiles\\testp"),
                Globals.Content.Load<Texture2D>("GFX\\Tiles\\testp2")*/

                Globals.Content.Load<Texture2D>("watertiles"),
                Globals.Content.Load<Texture2D>("grastiles")
            };

            FrogTextures = new Texture2D[]
            {
                Globals.Content.Load<Texture2D>("GFX\\Mobs\\Frog\\frogfront0001"),
                Globals.Content.Load<Texture2D>("GFX\\Mobs\\Frog\\frogfront0002"),
                Globals.Content.Load<Texture2D>("GFX\\Mobs\\Frog\\frogfront0003"),
                Globals.Content.Load<Texture2D>("GFX\\Mobs\\Frog\\frogfront0004"),
                Globals.Content.Load<Texture2D>("GFX\\Mobs\\Frog\\frogfront0005"),
                Globals.Content.Load<Texture2D>("GFX\\Mobs\\Frog\\frogfront0006"),
                Globals.Content.Load<Texture2D>("GFX\\Mobs\\Frog\\frogfront0007"),
                Globals.Content.Load<Texture2D>("GFX\\Mobs\\Frog\\frogfront0008"),
                Globals.Content.Load<Texture2D>("GFX\\Mobs\\Frog\\frogfront0009"),
                Globals.Content.Load<Texture2D>("GFX\\Mobs\\Frog\\frogfront0010"),
            };

            BatTextures = new Texture2D[]
            {
                Globals.Content.Load<Texture2D>("GFX\\Mobs\\Bat\\Bat0001"),
                Globals.Content.Load<Texture2D>("GFX\\Mobs\\Bat\\Bat0002"),
                Globals.Content.Load<Texture2D>("GFX\\Mobs\\Bat\\Bat0003"),
                Globals.Content.Load<Texture2D>("GFX\\Mobs\\Bat\\Bat0004"),
                Globals.Content.Load<Texture2D>("GFX\\Mobs\\Bat\\Bat0005"),
                Globals.Content.Load<Texture2D>("GFX\\Mobs\\Bat\\Bat0006"),
                Globals.Content.Load<Texture2D>("GFX\\Mobs\\Bat\\Bat0007"),
                Globals.Content.Load<Texture2D>("GFX\\Mobs\\Bat\\Bat0008"),
                Globals.Content.Load<Texture2D>("GFX\\Mobs\\Bat\\Bat0009")
            };

            waveManager = new WaveManager(level, 10, FrogTextures[0]);
            waterWavemanager = new WaterWaveManager(level,10, BatTextures[0]);
            player = new Player(level, towertextures, bullettextures);
            toolbar = new Toolbar(StatsWindow, font, new Vector2(500,550));
            menuScreen = new MenuScreen(Enter2Play, new Vector2(400, 300));
            arrowButton = new Button(grass,grass,grass, new Vector2(925,20),player,"Arrow Tower");
            PsnGasButton = new Button(grass,grass,grass, new Vector2(925,1), player,"Poison Gas");
            gamemanager = new GameManager(level,waterWavemanager, waveManager, Trapmenu);
            blabla = new AnimateSprite(blatex, new Vector2(100, 100),8,1);
            racoonmanager = new RacoonManager(level, blatex,player);
        }