Ejemplo n.º 1
0
        public virtual void Shoot()
        {
            if (BulletShot < Capacity)
            {
                BulletShot++;
                BaseBullet bullet = this.GetFirstBullet();

                if (bullet != null)
                {
                    ICollidable shooter = r_Shooter as ICollidable;

                    if (bullet.GroupRepresentative != shooter.GroupRepresentative)
                    {
                        bullet.GroupRepresentative = shooter.GroupRepresentative;
                    }

                    this.RemoveBullet();
                    bullet.Enabled = true;
                    bullet.Visible = true;
                }

                if (SoundActionOccurred != null)
                {
                    SoundActionOccurred.Invoke(ShootSoundName);
                }
            }
        }
Ejemplo n.º 2
0
 private void playLostLifeSound(int i_OldLives, int i_NewLives)
 {
     if (i_OldLives > i_NewLives && LifeLostSoundName != string.Empty && SoundActionOccurred != null)
     {
         SoundActionOccurred.Invoke(LifeLostSoundName);
     }
 }
Ejemplo n.º 3
0
 public override void Collided(ICollidable i_Collidable)
 {
     if (SoundActionOccurred != null)
     {
         SoundActionOccurred.Invoke(k_CollideSound);
     }
 }
Ejemplo n.º 4
0
        public void Focus()
        {
            IsFocused = true;

            if (IsInitialized)
            {
                SoundActionOccurred.Invoke(k_MenuItemFocusSound);
                this.StrokeSpriteFont.TintColor = Color.DeepSkyBlue;
                this.StrokeSpriteFont.Animations.Restart();
            }
        }
Ejemplo n.º 5
0
        private void checkIfAlive(int i_Lives)
        {
            if (m_Lives == 0)
            {
                if (SoundActionOccurred != null)
                {
                    SoundActionOccurred.Invoke(KilledSoundName);
                }

                IsAlive = false;
            }
            else if (m_Lives > 0)
            {
                IsAlive = true;
            }
        }