Example #1
0
        public void HandleHit(SpaceShip i_Target, ICollidable i_Collidable)
        {
            Player player = this.m_Players[(int)i_Target.Owner];

            if (i_Collidable is Bullet)
            {
                this.updatePlayerScoreAndSouls(i_Target.Owner);
                if (player.CurrentSoulsNum == 0)
                {
                    player.SpaceShip.Animations["Destroy"].Finished += new EventHandler(this.m_Players[(int)i_Target.Owner].destroyed_Finished);
                    player.SpaceShip.Animations["Destroy"].Finished += new EventHandler(this.player_Died);
                    player.SpaceShip.Animations["Destroy"].Restart();
                }
                else
                {
                    player.SpaceShip.Animations["LoosingSoul"].Restart();
                }

                this.m_SoundManager.PlaySoundEffect("LifeDie");
            }
            else if (i_Collidable is Enemy)
            {
                this.m_IsGameOver = true;
            }
        }
Example #2
0
 private void createSpaceShip(PlayerIndex i_PlayerType)
 {
     if (i_PlayerType == PlayerIndex.One)
     {
         this.m_SpaceShip = new SpaceShip(this.m_GameScreen, @"Sprites\Ship01_32x32", Bullet.eBulletType.PlayerOneBullet, PlayerIndex.One);
     }
     else
     {
         this.m_SpaceShip = new SpaceShip(this.m_GameScreen, @"Sprites\Ship02_32x32", Bullet.eBulletType.PlayerTwoBullet, PlayerIndex.Two);
     }
 }