Beispiel #1
0
        public CreepNextWaveBox(XmlEnemyList WaveList)
            : base("CreepNextWaveBox")
        {
            this.WaveList = WaveList;
            CurrentWave = 0;

            Width = 185;
            Height = 480;

            Background = new BackgroundItem(Color.AliceBlue);
            Background.FromSize(new Size(Width, Height));

            BoxTitle = new LabelItem("Incoming creeps");
            BoxTitle.Render();
            BoxTitle.X = (Width - BoxTitle.Width) / 2;
            BoxTitle.Y = 4;

            WavesGfx = new List<Surface>();

            foreach(XmlCreepWave wave in WaveList.Wave)
            {
                Surface gfx = new Surface("../../../../assets/Sprite/" + wave.GfxName + ".png");

                WavesGfx.Add(gfx);
            }
        }
        public NewGameWindow(Surface Screen)
            : base("NewGame", Screen.Width, Screen.Height, Screen)
        {
            Difficulty = GameDifficulty.Easy;
            MapName = "firstmap.xml";

            Maps = Map.GetMapsList("../../../../assets/Maps");

            LabelTitle = TitleFont.Render("Tower Defense RPG - New Game", Color.White);
            ptTitle = new Point(10, 10);

            Separator = new Surface(Width,2);

            Separator.Fill(Color.Gray);

            ptSep = new Point(0, (ptTitle.Y + LabelTitle.Height) + 5);
            ptSep2 = new Point(0, (ptTitle.Y + LabelTitle.Height) + 35);

            Background = new BackgroundItem(Color.DarkBlue);
            Background.Width = Width;
            Background.Height = Height;

            LabelDifficulty = new LabelItem("Difficulty : " + GameUtil.DifficultyToString(Difficulty));

            LabelDifficulty.X = 10;
            LabelDifficulty.Y = ptSep.Y + 8;
            LabelDifficulty.Foreground = Color.White;

            LabelDifficulty.Render();

            EasyDiffButton = new ButtonItem("EasyDiff", 120, 20, "Easy");
            EasyDiffButton.X = LabelDifficulty.X + LabelDifficulty.Width + 40;
            EasyDiffButton.Y = ptSep.Y + 5;

            MediumDiffButton = new ButtonItem("MediumDiff", 120, 20, "Medium");
            MediumDiffButton.X = LabelDifficulty.X + LabelDifficulty.Width + 170;
            MediumDiffButton.Y = ptSep.Y + 5;

            HardDiffButton = new ButtonItem("HardDiff", 120, 20, "Hard");
            HardDiffButton.X = LabelDifficulty.X + LabelDifficulty.Width + 300;
            HardDiffButton.Y = ptSep.Y + 5;

            MapGuiList = new ListGuiItem();

            MapGuiList.Width = 300;
            MapGuiList.Height = 400;

            MapGuiList.X = (Width - MapGuiList.Width) / 2;
            MapGuiList.Y = ptSep2.Y + 10;

            MapGuiList.Content = Maps;

            MapGuiList.Fill();

            MainMenuButton = new ButtonItem("MainMenu", 120,20, "Back");
            MainMenuButton.X = 10;
            MainMenuButton.Y = Height-MainMenuButton.Height - 10;

            StartGameButton = new ButtonItem("StartGame", 120,20, "Start Game");
            StartGameButton.X = Width - StartGameButton.Width - 10;
            StartGameButton.Y = Height - StartGameButton.Height - 10;

            ptSep3 = new Point(0,StartGameButton.Y - 5);

            Container.Add(Background);
            Container.Add(LabelDifficulty);
            Container.Add(EasyDiffButton);
            Container.Add(MediumDiffButton);
            Container.Add(HardDiffButton);
            Container.Add(StartGameButton);
            Container.Add(MainMenuButton);
        }