Exemplo n.º 1
0
        public static void Init(GraphicsDevice graphics)
        {
            UnlockedTowers = 0;
            rnd            = new Random();
            UiManager.UiScreens.Clear();
            UiSideScreen = new UiSideGameScreen(graphics);
            UiTopScreen  = new UiTopGameScreen(graphics);
            WaveManager.Reset();
            EnemyManager.Init();
            EnemyListener.InitiliseListener();
            TowerManager.Init();
            TowerListener.InitiliseListener();
            TroopManager.Init();
            TroopListener.InitiliseListener();
            QuestionPopUpManager.Init();

            // CHEATY TEST !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

            /*UnlockedTowers |= Unlocks.RocketTower;
             * UnlockedTowers |= Unlocks.SamTower;
             * UnlockedTowers |= Unlocks.TeslaTower;
             * UnlockedTowers |= Unlocks.Upgrade;
             * ModifyResources(100000);
             * for (int i = 0; i < 100; i++)
             *  TroopManager.SpawnTroop();*/
        }
Exemplo n.º 2
0
        public static Vector2 ScreenSize; // ScreenSize

        public static void Init(GraphicsDevice graphics)
        {
            rnd          = new Random();
            UiSideScreen = new UiSideGameScreen(graphics);
            UiTopScreen  = new UiTopGameScreen(graphics);
            EnemyListener.InitiliseListener();
            TowerListener.InitiliseListener();
        }
Exemplo n.º 3
0
        public Enemy(string enemyID, Vector2 enemyVector) : base()
        {
            ScreenPos = new Vector2(0, GameManager.grid.gridBorder.Y + GameManager.SQUARESIZE / 2);
            enemyVect = enemyVector;
            EnemyID   = enemyID;
            EnemyListener.AddEnemy(this);
            shootTimer = 2;

            animElasped = 0;
        }
Exemplo n.º 4
0
        /// <summary>
        /// Destroys enemies and cleans up references in other lists of said enemy
        /// </summary>
        static void DestroyEnemy(Enemy enemy, string TypeID, string EnemyID)
        {
            EnemyListener.RemoveEnemy(enemy);

            Enemies.Remove(enemy);

            int index2 = EnemyIDs.FindIndex(item => string.Compare(item, EnemyID, 0) == 0);

            if (index2 >= 0)
            {
                EnemyIDs.RemoveAt(index2);
            }
        }