Exemple #1
0
 public override void Update()
 {
     base.Update();
     if (PlayerManager.GetPlayerDeadOrAlive())
     {
         this.x += this.speed;
     }
 }
Exemple #2
0
        public override void Update()
        {
            base.Update();

            if (PlayerManager.GetPlayerDeadOrAlive())
            {
                this.y += 10.0f;
            }
        }
 public override void ShootMissile(Player pPlayer)
 {
     if (PlayerManager.GetPlayerDeadOrAlive())
     {
         Missile pMissile = PlayerManager.GetMissile();
         pMissile.x = pPlayer.x;
         pMissile.y = pPlayer.y + 20.0f;
         pMissile.SetFlyingStatus(true);
         pMissile.isDead = false;
         SoundManager.Play(Sound.Name.PlayerShoot);
         this.Handle(pPlayer);
     }
 }
Exemple #4
0
        public override void ShootMissile(Player pPlayer)
        {
            if (!PlayerManager.GetPlayerDeadOrAlive())
            {
                GameObject explosion = ExplosionManager.GetPlayerExplosion();
                pPlayer.x = explosion.x;
                pPlayer.y = explosion.y;
                PlayerManager.SetPlayerAlive();

                GameObject p = PlayerManager.GetMissile();
                p.x = -10;

                explosion.x = -100;
                explosion.y = -100;
                this.Handle(pPlayer);
            }
        }
Exemple #5
0
        public override void Execute(float deltaTime)
        {
            Debug.Assert(this.pGridHead != null);
            if (PlayerManager.GetPlayerDeadOrAlive())
            {
                switch (soundIdx)
                {
                case 0:
                    SoundManager.Play(Sound.Name.AlienMove1);
                    break;

                case 1:
                    SoundManager.Play(Sound.Name.AlienMove2);
                    break;

                case 2:
                    SoundManager.Play(Sound.Name.AlienMove3);
                    break;

                case 3:
                    SoundManager.Play(Sound.Name.AlienMove4);
                    break;

                default:
                    Debug.Assert(false);
                    break;
                }
                soundIdx++;
                if (soundIdx > 3)
                {
                    soundIdx = 0;
                }
                this.pGridHead.MoveAllAliens();
            }
            AlienManager.CheckDeltaTime();
            TimerManager.Add(TimeEvent.Name.MovementSprite, this, TimerManager.GetAlienDeltatTime());
        }