Ejemplo n.º 1
0
        /// <summary>
        /// Create an invader
        /// </summary>
        private Invader CreateInvader(Point p_position, int p_type, int[] p_sequence)
        {
            Invader sprite;

            switch (p_type)
            {
            default:
            case 1: sprite = new Invader(Constants.PATTERNINVADER1, _game._BrushInvader1, this.PixelSize, p_position, p_sequence, 30); break;

            case 2: sprite = new Invader(Constants.PATTERNINVADER2, _game._BrushInvader2, this.PixelSize, p_position, p_sequence, 20); break;

            case 3: sprite = new Invader(Constants.PATTERNINVADER3, _game._BrushInvader3, this.PixelSize, p_position, p_sequence, 10); break;
            }

            m_sprites.Add(sprite);

            return(sprite);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Create an invader
        /// </summary>
        private Invader CreateInvader(Point p_position, int p_type, int[] p_sequence)
        {
            Invader sprite;

            switch (p_type)
            {
            default:
            case 1: sprite = new Invader(Game.PatternInvader1, Game.BrushInvader1, this.PixelSize, p_position, p_sequence, 30); break;

            case 2: sprite = new Invader(Game.PatternInvader2, Game.BrushInvader2, this.PixelSize, p_position, p_sequence, 20); break;

            case 3: sprite = new Invader(Game.PatternInvader3, Game.BrushInvader3, this.PixelSize, p_position, p_sequence, 10); break;
            }

            m_sprites.Add(sprite);

            return(sprite);
        }
Ejemplo n.º 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);
            }
        }
Ejemplo n.º 4
0
 /// <summary>
 /// Destroy an invader
 /// </summary>
 private void DestroyInvader(Invader p_invader)
 {
     m_sprites.Remove(p_invader);
 }