Exemple #1
0
        public CombatLogBox(CombatLog Log,List<GuiItem> Garbage)
            : base("CombatLogBox")
        {
            this.Garbage = Garbage;
            Width = 250;
            Height = 200;
            this.Log = Log;
            MousePos = new Point();
            WinBar = new WindowBar("Combat Log", Width);
            WinBar.CloseButton = false;

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

            bOk = new ButtonItem("Ok", 120, 22, "Ok");
            bOk.Y = 170;
            bOk.X = (Width - bOk.Width) / 2;

            labelPhyDmg = new LabelItem("Physical Damage : "+Log.PhysicalDamage);

            labelMagDmg = new LabelItem("Magic Damage : " + Log.MagicDamage);

            labelCritDmg = new LabelItem("Critical Damage : " + Log.CriticalDamage);

            labelCritTimes = new LabelItem("Critical Times : " + Log.CriticalTimes);

            labelGoldStolen = new LabelItem("Gold Stolen : " + Log.GoldStolen);
        }
        public MainMenuWindow(Surface Screen)
            : base("MainMenu", Screen.Width, Screen.Height, Screen)
        {
            TitleLabelLine1 = TitleFont.Render("Tower Defense", Color.White);
            TitleLabelLine2 = TitleFont.Render("RPG", Color.White);

            Background = new BackgroundItem(Color.DarkBlue);
            NewGameButton = new ButtonItem("NewGame", 200, 40, "New Game");
            LoadGameButton = new ButtonItem("LoadGame", 200, 40, "Load Game");
            HighscoreButton = new ButtonItem("Highscore", 200, 40, "High Score");
            MapEditorButton = new ButtonItem("MapEdit", 200, 40, "Map Editor");
            QuitButton = new ButtonItem("Quit", 200, 40, "Quit");
            GameVersion = new LabelItem("Version : r74");
            GameVersion.Foreground = Color.WhiteSmoke;

            PlaceItem();

            FillContainer();
        }
Exemple #3
0
        public DialogBox(String Title, String Caption,int Width,int Height)
            : base("DialogBox",Width,Height)
        {
            this.Title = Title;
            this.Caption = Caption;

            this.Width = Width;
            this.Height = Height;

            WinBar = new WindowBar(Caption, Width);
            WinBar.CloseButton = false;
            Background = new BackgroundItem(Color.WhiteSmoke);
            Background.Width = Width;
            Background.Height = Height;

            CaptionLabel = new LabelItem(Caption);

            ButtonOk = new ButtonItem("OK_Dialog", 120, 22, "Ok");
        }
        public TextInputDialogBox(String Title,String Caption)
            : base("TextInputDialogBox")
        {
            this.Title = Title;
            this.Caption = Caption;

            this.Width = 360;
            this.Height = 150;

            TextEntry = "";

            WinBar = new WindowBar(Caption, Width);
            WinBar.CloseButton = false;
            Background = new BackgroundItem(Color.WhiteSmoke);
            Background.Width = Width;
            Background.Height = Height;

            CaptionLabel = new LabelItem(Caption);

            ButtonOk = new ButtonItem("OK_Dialog", 120, 22, "Ok");
        }
Exemple #5
0
        public UnitClassesChooser(List<GuiItem> Garbage)
            : base("UnitClassesBox")
        {
            Buttons = new List<ButtonItem>();

            Width = 400;
            Height = 160;
            this.Garbage = Garbage;

            MousePos = new Point();

            ChoosenClass = UnitClasses.None;

            WinBar = new WindowBar("Choose a Class", Width);
            WinBar.CloseButton = false;

            Background = new BackgroundItem(Color.LimeGreen);
            Background.X = 0;
            Background.Y = 0;
            Background.Width = Width;
            Background.Height = Height;

            bSoldier = new ButtonItem("Soldier", 120, 30, "Soldier");
            bSoldier.X = 10;
            bSoldier.Y = 30;

            bPaladin = new ButtonItem("Paladin", 120, 30, "Paladin");
            bPaladin.X = 140;
            bPaladin.Y = 30;

            bArcher = new ButtonItem("Archer", 120, 30, "Archer");
            bArcher.X = 270;
            bArcher.Y = 30;

            bMage = new ButtonItem("Mage", 120, 30, "Mage");
            bMage.X = 10;
            bMage.Y = 70;

            bThieft = new ButtonItem("Thieft", 120, 30, "Thieft");
            bThieft.X = 140;
            bThieft.Y = 70;

            bCancel = new ButtonItem("Cancel",120,30,"Cancel");
            bCancel.X = (Width - bCancel.Width) / 2;
            bCancel.Y = 110;

            Buttons.Add(bSoldier);
            Buttons.Add(bPaladin);
            Buttons.Add(bArcher);
            Buttons.Add(bMage);
            Buttons.Add(bThieft);
            Buttons.Add(bCancel);
        }
Exemple #6
0
        public PlayerUnitInfoBox(Point Pos)
            : base("PlayerUnitInfoBox")
        {
            this.Unit = new PlayerUnit();
            this.X = Pos.X;
            this.Y = Pos.Y;
            Width = 185;
            Height = 300;
            MousePos = Mouse.MousePosition;
            Background = new BackgroundItem(Color.PaleGreen);
            Background.Width = Width;
            Background.Height = Height;

            labelClass = new LabelItem();

            labelLevel = new LabelItem();

            labelStr = new LabelItem();

            labelInt = new LabelItem();

            labelLuck = new LabelItem();

            labelDmgType = new LabelItem();

            labelNxLvlCost = new LabelItem();

            buttonIncLevel = new ButtonItem("levelup", 160, 22, "Increase to Level " + (Unit.Level + 1));
            buttonIncLevel.Y = 220;
            buttonIncLevel.X = (Width - buttonIncLevel.Width) / 2;
            UpdateCaption();
        }
Exemple #7
0
        public GameOverBox(GameObject GameObj,List<GuiItem> Garbage)
            : base("GameOverBox")
        {
            Width = 400;
            Height = 400;
            this.Garbage = Garbage;
            this.GameObj = GameObj;
            MousePos = new Point();
            Background = new BackgroundItem(Color.WhiteSmoke);
            Background.Width = Width;
            Background.Height = Height;
            font = new SdlDotNet.Graphics.Font("../../../../assets/GameData/VeraSe.ttf", 36);
            bContinue = new ButtonItem("Continue",120,22,"Try Again");
            bContinue.X = 100;
            bContinue.Y = 300;

            bQuit = new ButtonItem("Quit",120,22,"Quit");
            bQuit.X = 230;
            bQuit.Y = 300;
        }
Exemple #8
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);
            }
        }
Exemple #9
0
        public CreepInfoBox()
            : base("CreepInfoBox")
        {
            Width = 185;
            Height = 50;

            Unit = new CreepUnit("None", 0, 0);

            Background = new BackgroundItem(Color.LemonChiffon);
            Background.Width = Width;
            Background.Height = Height;
        }
Exemple #10
0
        public WaveInfoBox(XmlCreepWave Wave, List<GuiItem> Garbage)
            : base("WaveInfoBox")
        {
            this.Wave = Wave;
            this.Garbage = Garbage;
            Width = 300;
            Height = 300;

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

            TimeBar = new Rectangle(new Point(10,220),new Size(Width-20,22));
            TimeBarBorder = new Box(TimeBar.Location, TimeBar.Size);

            labelHealth = new LabelItem();
            labelResist = new LabelItem();
            labelWeakness = new LabelItem();
            labelNumbers = new LabelItem();
            labelName = new LabelItem();
            labelTips = new LabelItem();
            labelTitle = new LabelItem("Next Wave");
        }
        public EditorWindow(Surface Screen)
            : base("Map Editor", 640, 800, Screen)
        {
            AppsDirectory = Directory.GetCurrentDirectory();

            TexIndex = TextureIndex.LoadTextureIndex("../../../../assets/Textures/MapTiles.xml");

            Textures = TexIndex.LoadTextures();

            map = new Map();
            ButtonBg = new BackgroundItem(Color.LightGray);
            ButtonBg.Width = Width;
            ButtonBg.Height = 100;
            ButtonBg.X = 0;
            ButtonBg.Y = 0;

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

            //WinBar = new WindowBar("Map Editor", Width);
            //WinBar.CloseButton = true;

            LoadMapButton = new ButtonItem("LoadMap", 120, 22, "Load Map");
            LoadMapButton.X = 20;
            LoadMapButton.Y = 30;

            SaveMap = new ButtonItem("SaveMap", 120, 22, "Save Map");
            SaveMap.X = 146;
            SaveMap.Y = 30;

            NewMap = new ButtonItem("NewMap", 120, 22, "New Map");
            NewMap.X = 272;
            NewMap.Y = 30;

            ChangeMapName = new ButtonItem("ChangeMapName", 140, 22, "Change Map Name");
            ChangeMapName.X = 398;
            ChangeMapName.Y = 30;

            SetDefaultTexture = new ButtonItem("SetDefaultTexture", 140, 22, "Set Default Texture");
            SetDefaultTexture.X = 20;
            SetDefaultTexture.Y = 4;

            QuitButton = new ButtonItem("Quit", 100, 22, "Quit");
            QuitButton.X = 166;
            QuitButton.Y = 4;

            mapRenderer = new MapEditRenderer(map,Textures);
            mapRenderer.X = 20;
            mapRenderer.Y = 120;

            MapGrid = new Grid(40, 40);
            MapGrid.Width = 40 * map.Columns;
            MapGrid.Height = 40 * map.Rows;
            MapGrid.X = 20;
            MapGrid.Y = 120;

            MapNameLabel = new LabelItem("Map Name : " + map.MapName);
            MapNameLabel.X = 16;
            MapNameLabel.Y = 65;

            RowLabel = new LabelItem("Row : -");
            RowLabel.X = 20;
            RowLabel.Y = 610;
            ColumnLabel = new LabelItem("Column : -");
            ColumnLabel.X = 20;
            ColumnLabel.Y = 630;

            MapNameDialog = new TextInputDialogBox("Map Name", "Map Name");
            MapNameDialog.X = (Width - MapNameDialog.Width) / 2;
            MapNameDialog.Y = (Height - MapNameDialog.Height) / 2;

            MessageBox = new DialogBox("Message", "Not set");
            MessageBox.X = (Width - MessageBox.Width) / 2;
            MessageBox.Y = (Height - MessageBox.Height) / 2;

            openFile = new OpenFileDialog();
            openFile.InitialDirectory = @"..\..\..\..\Assets\Maps\";
            openFile.Multiselect = false;
            openFile.Title = "Load a Map";
            openFile.Filter = "XML T.D. Map (*.xml) | *.xml";

            Container.Add(Background);
            Container.Add(ButtonBg);

            //Container.Add(WinBar);

            Container.Add(LoadMapButton);
            Container.Add(SaveMap);
            Container.Add(NewMap);
            Container.Add(ChangeMapName);
            Container.Add(SetDefaultTexture);
            Container.Add(QuitButton);

            Container.Add(MapNameLabel);
            Container.Add(RowLabel);
            Container.Add(ColumnLabel);

            Container.Add(mapRenderer);
            Container.Add(MapGrid);

            //Container.Add(MapNameDialog);

            MapNameDialog.SetEvents();
        }
Exemple #12
0
        public void Init()
        {
            TextureIndex Textures = TextureIndex.LoadTextureIndex("../../../../assets/Textures/MapTiles.xml");
            CreepTextures = CreepTextureIndex.LoadIndex("../../../../assets/GameData/CreepSpriteIndex.xml");
            MapTiles = Textures.LoadTextures();

            GameStartP = new Point(200, 100);

            CritSprites = new TextSpriteList();

            MapRender = new MapRenderer(GameObj.map, MapTiles);
            CreepRender = new CreepRenderer(CreepTextures.GetEntry(GameObj.CurrentWave.GfxName));

            GameRectangle = new Rectangle(GameStartP,new Size(GameObj.map.Columns*Tile.TILE_WIDTH,GameObj.map.Rows*Tile.TILE_HEIGHT));
            SelectedTile = new MapCoord();

            MageSprites = new MageAttackSprites();

            TopLevelContainer = new List<GuiItem>();

            MapBackground = MapRender.Render();

            Background = new BackgroundItem(Color.WhiteSmoke);
            Background.X = 0;
            Background.Y = 0;
            Background.Width = Width;
            Background.Height = Height;

            ButtonPanel = new BackgroundItem(Color.LightGray);
            ButtonPanel.X = 0;
            ButtonPanel.Y = 0;
            ButtonPanel.Width = Width;
            ButtonPanel.Height = 80;

            HudPanel = new BackgroundItem(Color.SteelBlue);
            HudPanel.X = 0;
            HudPanel.Y = 640;
            HudPanel.Width = Width;
            HudPanel.Height = 120;

            CloseButton = new ButtonItem("Close",120,22,"Quit");
            CloseButton.X = 10;
            CloseButton.Y = 20;

            PauseButton = new ButtonItem("Pause", 120, 22, "Pause");
            PauseButton.X = 140;
            PauseButton.Y = 20;

            StartWaveButton = new ButtonItem("StartWave", 120, 22, "Start Wave");
            StartWaveButton.X = 270;
            StartWaveButton.Y = 20;

            CombatLogButton = new ButtonItem("CombatLog", 120, 22, "View Combat Log");
            CombatLogButton.X = 10;
            CombatLogButton.Y = 50;

            BuyUnitButton = new ButtonItem("BuyUnit", 120, 22, "Buy a Unit");
            BuyUnitButton.X = 140;
            BuyUnitButton.Y = 50;

            ResetButton = new ButtonItem("Reset", 120, 22, "Restart");
            ResetButton.X = 270;
            ResetButton.Y = 50;

            LabelScore = new LabelItem("Score : 0");
            LabelScore.X = 10;
            LabelScore.Y = 650;
            LabelScore.Foreground = Color.White;

            LabelWave = new LabelItem("Wave : " + GameObj.Wave);
            LabelWave.X = 350;
            LabelWave.Y = 650;
            LabelWave.Foreground = Color.White;

            LabelCrystal = new LabelItem("Crystal Left : " + GameObj.Crystal);
            LabelCrystal.X = 10;
            LabelCrystal.Y = 680;
            LabelCrystal.Foreground = Color.White;

            LabelGold = new LabelItem("Gold : " + GameObj.Gold);
            LabelGold.X = 350;
            LabelGold.Y = 680;
            LabelGold.Foreground = Color.White;

            LabelFps = new LabelItem("Fps : 30");
            LabelFps.X = Width - 70;
            LabelFps.Y = 4;

            LogBox = new CombatLogBox(GameObj.LastCombatLog, Garbage);

            UnitInfoBox = new PlayerUnitInfoBox(new Point(GameStartP.X + GameRectangle.Width + 10,GameStartP.Y));

            CreepBox = new CreepInfoBox();
            CreepBox.FromPoint(new Point(GameStartP.X + GameRectangle.Width + 10, GameStartP.Y + UnitInfoBox.Height + 10));

            UnitClassesChooserBox = new UnitClassesChooser(Garbage);
            UnitClassesChooserBox.X = GameStartP.X + ((GameRectangle.Width - UnitClassesChooserBox.Width) / 2); ;
            UnitClassesChooserBox.Y = GameStartP.Y + ((GameRectangle.Height - UnitClassesChooserBox.Height) / 2); ;

            WaveBox = new WaveInfoBox(GameObj.GetNextWaveInfo(),Garbage);
            WaveBox.X = GameStartP.X + ((GameRectangle.Width - WaveBox.Width) / 2);
            WaveBox.Y = GameStartP.Y + ((GameRectangle.Height - WaveBox.Height) / 2);

            NextWaveBox = new CreepNextWaveBox(GameObj.CreepWaves);
            NextWaveBox.X = 10;
            NextWaveBox.Y = GameStartP.Y;

            PlayerNameDialog = new TextInputDialogBox("Highscore Entry", "Player Name : ");
            PlayerNameDialog.X = (Width - PlayerNameDialog.Width) / 2;
            PlayerNameDialog.Y = (Height - PlayerNameDialog.Height) / 2;
            PlayerNameDialog.TextEntry = PlayerName;

            Container.Add(Background);
            Container.Add(ButtonPanel);
            Container.Add(HudPanel);

            Container.Add(CloseButton);
            Container.Add(PauseButton);
            Container.Add(StartWaveButton);
            Container.Add(CombatLogButton);
            Container.Add(BuyUnitButton);
            Container.Add(ResetButton);

            Container.Add(LabelScore);
            Container.Add(LabelCrystal);
            Container.Add(LabelWave);
            Container.Add(LabelGold);

            Container.Add(LabelFps);

            Container.Add(NextWaveBox);
            Container.Add(UnitInfoBox);
            Container.Add(CreepBox);
        }
        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);
        }