Beispiel #1
0
        /// <summary>
        /// Create a saucer
        /// </summary>
        private Saucer CreateSaucer(Point p_position)
        {
            Saucer sprite = new Saucer(Constants.PATTERNSAUCER, _game._BrushSaucer, this.PixelSize, p_position, new int[] { 0, 1 }, ( uint )m_randomNumber.Next(5, 15) * 10);

            this.Saucer = sprite;
            m_sprites.Add(sprite);

            return(sprite);
        }
Beispiel #2
0
        /// <summary>
        /// Create a saucer
        /// </summary>
        private Saucer CreateSaucer(Point p_position)
        {
            Saucer sprite = new Saucer(Game.PatternSaucer, Game.BrushSaucer, this.PixelSize, p_position, new int[] { 0, 1 }, (uint)m_randomNumber.Next(5, 15) * 10);

            this.Saucer = sprite;
            m_sprites.Add(sprite);

            return(sprite);
        }
Beispiel #3
0
        /// <summary>
        /// Destroy an enemy
        /// </summary>
        private void DestroyEnemy(IEnemy p_enemy)
        {
            this.Score += p_enemy.Points;

            if (p_enemy is Invader)
            {
                Invader invader = p_enemy as Invader;

                DestroyInvader(invader);
                this.EnemyExplosion = new Explosion(Constants.PATTERNEXPLOSION, invader.Foreground, this.PixelSize, invader.GetPosition(), 20);
            }
            else if (p_enemy is Saucer)
            {
                Saucer saucer = p_enemy as Saucer;

                DestroySaucer();
                this.EnemyExplosion = new Explosion(saucer.Points, saucer.Foreground, saucer.GetPosition(), 80);
            }
        }
Beispiel #4
0
 /// <summary>
 /// Destroy a saucer
 /// </summary>
 /// <returns></returns>
 private void DestroySaucer()
 {
     m_sprites.Remove(this.Saucer);
     this.Saucer = null;
 }