/// <summary>
        /// Constructor for the Missle Enemy.
        /// </summary>
        /// <param name="position"></param>
        public MineEnemy(Vector2 position, Player playerOne, Texture2D mineSpawnerTexture, Texture2D mineTexture)
        {
            m_mineEnemyTexture = mineSpawnerTexture;
            m_mineTexture = mineTexture;
            m_pPlayer = playerOne;
            m_position = position;
            m_spriteScale = 0.35f;
            m_dimensions = new Vector2(128, 128) * m_spriteScale;
            m_origin = (m_dimensions / 2.0f) / m_spriteScale;

            m_maxVelocity = 0.0f;
            m_turningSpeed = 150.0f;
            m_wanderPosition = new Vector2();

            m_detectionRadius = new Circle(m_position, 100);
            m_collisionRadius = new Circle(m_position, m_dimensions.X / 2 * m_spriteScale);
            
            m_directionChange = 2.0f;
            m_addMineCountdown = 2.0f;

            m_lerpColour = 0.0f;

            m_mineList = new List<Mine>();

            m_slowMotion = false;
        }
        /// <summary>
        /// Constructor for the Seeker Enemy.
        /// </summary>
        /// <param name="position"></param>
        public SeekerEnemy(Vector2 position, Texture2D seekerEnemyTexture, Texture2D seekerEnemyRotatingBladeTexture, Player pPlayer)
        {
            m_seekerEnemyTexture = seekerEnemyTexture;
            m_seekerEnemyRotatingBladeTexture = seekerEnemyRotatingBladeTexture;
            m_facingDirection = new Vector2();
            m_position = position;
            m_spriteScale = 0.35f;
            m_dimensions = new Vector2(64, 64) * m_spriteScale;
            m_origin = (m_dimensions / 2.0f) / m_spriteScale;

            m_collisionRadius = new Circle(m_position, m_dimensions.X / 2);
            m_flocking = false;

            m_speed = 14.0f;
            m_bladeRotation = 0.0f;
            m_rotationAngle = 0.0f;

            m_seekingPosition = new Vector2(0, 0);

            m_pPlayer = pPlayer;

            m_maxVelocity = 20.0f;

            m_colorlerp = 0.0f;

            m_slowMotion = false;
        }
Beispiel #3
0
        /// <summary>
        /// Overloaded Constructor
        /// </summary>
        /// <param name="position"></param>
        /// <param name="shieldTexture"></param>
        /// <param name="powerup"></param>
        /// <param name="player"></param>
        public Shield(Vector2 position, PowerUp powerup, Player player)
        {
            m_player = player;
            m_shieldTexture = AIE.GameStateManager.Game.Content.Load<Texture2D>("Images/ShieldTexture3");
            m_position = position;
            m_powerup = powerup;
            m_scale = 1.0f;
            m_dimensions = new Vector2(110, 110) / m_scale;
            m_origin = (m_dimensions / 2.0f);
            m_collisionRadius = new Circle(m_position, m_dimensions.X / 2);
            m_rotation = 0.0f;
            m_shieldTime = 15.0f;
            m_timerPosition = new Vector2(0, 0);
            m_lerpTimer = 0.0f;

            m_peakHit = false;
        }
Beispiel #4
0
        public PowerUp(Vector2 position, Texture2D powerupTexture, int powerupID, PlayState playState, Player pPlayer)
        {
            m_playState = playState;
            m_player = pPlayer;

            m_texture = AIE.GameStateManager.Game.Content.Load<Texture2D>("Images/ShieldTexture3");

            m_position = position;
            m_spriteScale = 0.45f;
            m_dimensions = new Vector2(110, 110) * m_spriteScale;
            m_origin = (m_dimensions / 2.0f) / m_spriteScale;
            m_collisionRadius = new Circle(m_position, m_dimensions.X / 2);
            m_rotationAngle = 0.0f;

            m_powerupID = powerupID;
            m_activePowerup = true;
            m_countdown = 10.0f;
        }
        /// <summary>
        /// Constructor for the playState
        /// </summary>
        public PlayState() : base()
        {
            m_player1 = new Player();
            m_gameOver = false;

            Globals.m_gameCamera.Zoom = 0.35f;
            m_score = 0;
            m_multiplier = 1;
            m_subMultiplier = 0;
            m_scorePosition = new Vector2(0, 0);

            m_slowMotionEffection = content.Load<SoundEffect>("Sounds/SlowMotion");
            m_enemyExplosion = content.Load<SoundEffect>("Sounds/EnemyDeath");
            m_enemyExplosionList = new List<SoundEffectInstance>();

            for (int i = 0; i < 10; i++)
            {
                m_enemyExplosionList.Add(m_enemyExplosion.CreateInstance());
            }


            m_borderLerp = 0.0f;
            m_borderRed = false;

            m_lerpTimer = 0.0f;
            m_bombTimer = 0.0f;
            m_timerPosition = new Vector2(0, 0);
            m_peakHit = false;
            m_multifireDraw = false;
            m_bombDraw = false;
            m_speedUpDraw = false;
            m_firerateUpDraw = false;
            m_bombExplosion = false;
            m_peakBombHit = false;

            m_slowMotionTimer = 0.0f;
            m_multiplierDrop = 20.0f;
            m_multiplierDropTimer = 1.0f;

            m_enemySpawnX = 0;
            m_enemySpawnY = 0;
            m_seekerSpawnX = 0;
            m_seekerSpawnY = 0;
            m_multiSpawnX = 0;
            m_multiSpawnY = 0;
            m_mineSpawnX = 0;
            m_mineSpawnY = 0;

            m_bulletList = new List<Bullet>();
            m_mineList = new List<Mine>();

            m_gameBegin = false;
            m_gameBeginTimer = 5.0f;
            m_fadeInHUD = 0.0f;

            m_lerpBombTimer = 0.0f;
            

            #region LOADING_CONTENT

            m_levelBackgroundTexture = content.Load<Texture2D>("Images/levelbackground");
            m_bottomBoundary = content.Load<Texture2D>("Images/Border");
            m_topBoundary = content.Load<Texture2D>("Images/TopBorder");
            m_leftBoundary = content.Load<Texture2D>("Images/LeftBorder");
            m_rightBoundary = content.Load<Texture2D>("Images/RightBorder");
            m_whiteBoundary = content.Load<Texture2D>("Images/WhiteRectangleBoundry");
            m_playerBulletTexture = content.Load<Texture2D>("Images/PlayerBullet");
            m_missleEnemyTexture = content.Load<Texture2D>("Images/MissileEnemy");
            m_seekerEnemyTexture = content.Load<Texture2D>("Images/SeekerEnemy");
            m_seekerEnemyRotatingBladeTexture = content.Load<Texture2D>("Images/SeekerEnemyRotatingBlades");
            m_mineEnemyTexture = content.Load<Texture2D>("Images/MineEnemy");
            m_mineTexture = content.Load<Texture2D>("Images/Mine");
            m_topHUD = content.Load<Texture2D>("Images/TopHUD");
            m_whiteBorder = content.Load<Texture2D>("Images/WhiteRectangleBoundry");

            m_multiDirectionalEnemyTexture = content.Load<Texture2D>("Images/DirectionalShooter");
            m_enemyBullet = content.Load<Texture2D>("Images/EnemyBullet");

            m_red3SpriteSheet = content.Load<Texture2D>("Images/red3");
            m_green3SpriteSheet = content.Load<Texture2D>("Images/green3");
            m_blue3SpriteSheet = content.Load<Texture2D>("Images/blue3");
            m_yellow0SpriteSheet = content.Load<Texture2D>("Images/yellow0");

            m_bombPowerUpTexture = content.Load<Texture2D>("Images/EnemyBullet");
            m_multiplierNotLit = content.Load<Texture2D>("Images/MultiplierNotLit");
            m_multiplierLit = content.Load<Texture2D>("Images/MultiplierLit");
            m_bombFlash = content.Load<Texture2D>("Images/BombFlash");

            #endregion

            #region ANIMATION_LISTS

            m_redAnimation = new List<TextureAtlas.AnimatedSprite>();
            m_greenAnimation = new List<TextureAtlas.AnimatedSprite>();
            m_blueAnimation = new List<TextureAtlas.AnimatedSprite>();
            m_yellowAnimation = new List<TextureAtlas.AnimatedSprite>();

            for (int i = 0; i < 10; i++)
            {
                // PLEASE READ
                // ALL EXPLOSIONS CURRENTLY USE THE RED EXPLOSION SPRITESHEET
                // TO CHANGE THIS, LOAD IN A DIFFERENT SPRITESHEET AND REPLACE "m_red3SpriteSheet" WITH THAT 2D TEXTURE

                m_redAnimation.Add(new TextureAtlas.AnimatedSprite(m_red3SpriteSheet, 5, 16, 80, 2, 1.5f));
                m_greenAnimation.Add(new TextureAtlas.AnimatedSprite(m_green3SpriteSheet, 5, 16, 80, 2, 1.5f));
                m_blueAnimation.Add(new TextureAtlas.AnimatedSprite(m_blue3SpriteSheet, 5, 16, 80, 2, 1.5f));
                m_yellowAnimation.Add(new TextureAtlas.AnimatedSprite(m_yellow0SpriteSheet, 5, 16, 80, 2, 1.5f));

                m_redAnimation[i].m_finished = true;
                m_greenAnimation[i].m_finished = true;
                m_blueAnimation[i].m_finished = true;
                m_yellowAnimation[i].m_finished = true;
            }

            #endregion

            #region ENEMY_RELATED

            m_missileEnemyList = new List<MissleEnemy>();
            m_seekerEnemyList = new List<SeekerEnemy>();
            m_multiShooterList = new List<MultiShooterEnemy>();
            m_mineEnemyList = new List<MineEnemy>();

            m_missileEnemyCD = 2.0f;
            m_multiEnemyCD = 4.0f;

            #endregion

            #region POWERUP_RELATED

            m_powerupList = new List<PowerUp>();

            m_powerupTimer = 16.0f;
            m_powerupSpwan = 10.0f;
            m_shieldTime = 0.0f;
            m_timeSpeedUp = 0;
            m_fireRateIncreased = 0;
            m_powerupUsed = false;
            m_shieldActive = false;

            #endregion

        }