public static void LoadCurrentLevel(GameplayScreen gameplayScreen, int level, ContentManager content)
 {
     GameOver = false;
     LevelWon = false;
     switch (level)
     {
         case 0:
             _currentLevel = new SurvivalLevel();
             break;
         case 1:
             _currentLevel = new LevelOne();
             break;
         case 2:
             _currentLevel = new LevelTwo();
             break;
         case 3:
             _currentLevel = new LevelThree();
             break;
         case 4:
             _currentLevel = new LevelFour();
             break;
         case 5:
             _currentLevel = new FinalLevel();
             break;
     }
     _currentLevel.Load(gameplayScreen,content);
 }
Exemple #2
0
 public Laser(GameplayScreen gameplayScreen, GameCharacter owner)
     : base(gameplayScreen, owner)
 {
     beam = new BasicPrimitives(gamePlayScreen.ScreenManager.GraphicsDevice);
     //Default beam colour can be changed with public property
     LaserColour = new Color(255, 255, 255, 180);
     LaserThickness = 2;
     coolDownTime = 3.5;
     coolDownElapsed = 0;
     burstDuration = 1.5;
     dps = 20;
 }
 public static void AddEnemy(GameplayScreen gameplayScreen, string name, Vector2 position, GameCharacter target)
 {
     if(name.StartsWith("Gr"))
     {
         var g = new Grunt(gameplayScreen){Center = position};
         g.Initialize();
         g.Name = name;
         if(target != null)
         g.Target = target;
         _enemies.Add(g);
     }
     else if(name.StartsWith("So"))
     {
         var m = new Soldier(gameplayScreen) { Center = position };
         m.Initialize();
         m.Name = name;
         m.Target = target;
         _enemies.Add(m);
         NumSoldiers += 1;
     }
     else if(name.StartsWith("Sp"))
     {
         var s = new Spawner(gameplayScreen) { Center = position };
         s.Initialize();
         s.Name = name;
         s.Target = target;
         _enemies.Add(s);
     }
     else if(name.StartsWith("Bo"))
     {
         _boss = new Boss(gameplayScreen) { Center = position };
         _boss.Initialize();
         _boss.Name = name;
         NumBosses++;
         _boss.Target = target;
         _enemies.Add(_boss);
         _boss.Died += new DeathEventHandler(_boss_Died);
     }
 }
 public static void Initialize(Game game, GameplayScreen gamePlayScreen, Nathaniel nathaniel, Hermes hermes)
 {
     PlayerCharacters = new List<GameCharacter>();
     _nathaniel = nathaniel;
     _hermes = hermes;
     _nathaniel.Initialize();
     _hermes.Initialize();
     PlayerCharacters.Add(_nathaniel);
     PlayerCharacters.Add(_hermes);
     GameplayScreen.FocusedAgent = Nathaniel;
     BuildMenu = new BuildStructureMenu(game, gamePlayScreen);
     BuildMenu.Initialize();
 }
 public PauseMenu(Game game, GameplayScreen gameplayScreen)
     : base(game, gameplayScreen)
 {
 }
 protected ProjectileWeapon(GameplayScreen gameplayScreen, GameCharacter owner)
     : base(gameplayScreen, owner)
 {
     ammo = new List<Projectile>();
 }
 public GameOverScreen(Game game, GameplayScreen gameplayScreen)
     : base(game)
 {
     _gameplayScreen = gameplayScreen;
     _vp = _gameplayScreen.ScreenManager.GraphicsDevice.Viewport;
 }
 protected PopUpScreen(Game game, GameplayScreen gameplayScreen)
     : base(game)
 {
     this.gameplayScreen = gameplayScreen;
 }
 protected BadGameCharacter(GameplayScreen gamePlayScreen)
     : base(gamePlayScreen)
 {
 }
 public static void AddEnemy(GameplayScreen gameplayScreen, string name, Vector2 position)
 {
     AddEnemy(gameplayScreen, name, position, null);
 }
 protected DefensiveStructure(GameplayScreen gamePlayScreen)
     : base(gamePlayScreen)
 {
 }
 public Soldier(GameplayScreen gamePlayScreen)
     : base(gamePlayScreen)
 {
 }
Exemple #13
0
 public Grunt(GameplayScreen gamePlayScreen)
     : base(gamePlayScreen)
 {
 }
 public BuildStructureMenu(Game game, GameplayScreen gameplayScreen)
     : base(game)
 {
     _gameplayScreen = gameplayScreen;
     _vp = _gameplayScreen.ScreenManager.GraphicsDevice.Viewport;
 }
 public HealTower(GameplayScreen gamePlayScreen)
     : base(gamePlayScreen)
 {
 }
 protected GameCharacter(GameplayScreen gamePlayScreen)
 {
     this.gamePlayScreen = gamePlayScreen;
     healthbar = new HealthBar(ImageManager.HealthBarTexture, this);
 }
Exemple #17
0
        public static void Initialize(GameplayScreen gameplayScreen)
        {
            _gameplayScreen = gameplayScreen;
            var vp = _gameplayScreen.ScreenManager.GraphicsDevice.Viewport;

            _displayTime = "";

            var sideMargin = vp.Width * 0.01f;
            var topMargin = vp.Height * 0.01f;
            var bottomMargin = vp.Height * 0.1f;

            _topLeft = new Vector2(vp.X + sideMargin, vp.Y + topMargin);
            _topCenterLeft = new Vector2(vp.X + vp.Width / 4 + sideMargin, vp.Y + topMargin);
            _topCenterRight = new Vector2(vp.X + vp.Width / 2 + sideMargin, topMargin);
            _topRight = new Vector2(vp.X + vp.Width * 0.75f + sideMargin, vp.Y + topMargin);

            _bottomLeft = new Vector2(vp.X + sideMargin, vp.Height - bottomMargin);
            _bottomCenterLeft = new Vector2(vp.X + vp.Width / 4 + sideMargin, vp.Height - bottomMargin);
            _bottomCenterRight = new Vector2(vp.X + vp.Width / 2 + sideMargin, vp.Height - bottomMargin);
            _bottomRight = new Vector2(vp.X + vp.Width * 0.75f + sideMargin, vp.Height - bottomMargin);

            _hudTextColour = Color.Bisque;
            _nathanielIconColour = Color.White;
            _hermesIconColour = Color.White;

            var backdropHeight = (int)bottomMargin;
            var iconWidth = (int)(vp.Width * 0.125f);
            var iconHeight = (int)(backdropHeight * 0.75f);
            const int spacing = 10;

            _backDrop = new Rectangle(0, 0, vp.Width, backdropHeight);
            //Populate the top part of the HUD
            HermesButton = new Rectangle((int)_topLeft.X, (int)_topLeft.Y, iconWidth, iconHeight);
            HermesModeButton = new Rectangle((int)_topLeft.X, HermesButton.Bottom, iconWidth, iconHeight);
            NathanielButton = new Rectangle((int)_topLeft.X + iconWidth + spacing, (int)_topLeft.Y, iconWidth, iconHeight);
            _heartIconArea = new Rectangle(NathanielButton.Right+spacing, (int)_topLeft.Y+spacing, iconWidth-spacing*2, iconHeight-spacing);
            _livesNumberPosition = new Vector2(_heartIconArea.Center.X - 11, _heartIconArea.Center.Y - 22);
            _recourcesTextPosition = new Vector2(_heartIconArea.Right+spacing, _topRight.Y);
            _clockIconArea = new Rectangle(_heartIconArea.Right+spacing*20, (int)_topRight.Y, 30,30);
            _timeNumberPosition = new Vector2(_clockIconArea.Right+spacing, _topRight.Y);
            MenuButton = new Rectangle((int)_topRight.X+spacing*4, (int)_topRight.Y, (int)(iconWidth*1.25f), iconHeight);
        }
 public Spawner(GameplayScreen gamePlayScreen)
     : base(gamePlayScreen)
 {
 }
Exemple #19
0
 public Hermes(GameplayScreen gamePlayScreen)
     : base(gamePlayScreen)
 {
 }
 public Nathaniel(GameplayScreen gamePlayScreen)
     : base(gamePlayScreen)
 {
 }
 public GunTower(GameplayScreen gamePlayScreen)
     : base(gamePlayScreen)
 {
 }