Beispiel #1
0
 private void CheckIfLevelUp()
 {
     if (Convert.ToInt32(UC_ControlArea.BaseStage.Content) > actLevel.levelNr)
     {
         actLevel          = levelManager.GetActLevel(Convert.ToInt32(UC_ControlArea.BaseStage.Content));
         actBaseStage      = actLevel.levelNr;
         actResourcePoints = actLevel.resourcePoints;
         actWallStage      = actLevel.wallStage;
         actGoldMineLevel  = actLevel.village.goldMineLevel;
         actStoneMineLevel = actLevel.village.stoneMineLevel;
         village           = actLevel.village;
         VillageGenerator.Generate_Village(village, gameField.Grid);
     }
 }
Beispiel #2
0
        public Game(UserControl i_UCConArea, UserControl i_UCField, MainWindow mndw)
        {
            mainWndw       = mndw;
            uc_ControlArea = i_UCConArea;
            uc_Field       = i_UCField;
            gameField      = new GameField(true);
            gameClock      = new Clock();
            levelManager   = new LevelManager();

            UC_ControlArea.game = this;

            mainTimer          = new System.Windows.Forms.Timer();
            mainTimer.Interval = 500;
            mainTimer.Tick    += new EventHandler(TimerTick_HalfSec_Func);
            mainTimer.Start();

            actLevel          = levelManager.GetActLevel(1);
            actBaseStage      = actLevel.levelNr;
            actResourcePoints = actLevel.resourcePoints;
            actWallStage      = actLevel.wallStage;
            actGoldMineLevel  = actLevel.village.goldMineLevel;
            actStoneMineLevel = actLevel.village.stoneMineLevel;
            village           = actLevel.village;

            actGoldValue  = 0;
            actStoneValue = 0;

            VillageGenerator.Generate_Village(village, gameField.Grid);

            gb1 = new Goblin(gameField);
            gb2 = new Goblin(gameField);
            gb3 = new Goblin(gameField);
            gb4 = new Goblin(gameField);
            gb5 = new Goblin(gameField);
            gb6 = new Goblin(gameField);
            gb7 = new Goblin(gameField);
            gb8 = new Goblin(gameField);
        }