示例#1
0
        public override void Draw(Graphics g)
        {
            TheBomb.setKInterval(setBombSpeed);

            UpdateBounds();

            if (BeenHit)
            {
                DrawExplosion(g);
                return;
            }

            if (Counter % 2 == 0)
            {
                g.DrawImage(TheImage, MovingBounds, 0, 0, ImageBounds.Width, ImageBounds.Height, GraphicsUnit.Pixel);
            }
            else
            {
                g.DrawImage(OtherImage, MovingBounds, 0, 0, ImageBounds.Width, ImageBounds.Height, GraphicsUnit.Pixel);
            }

            if (ActiveBomb)
            {
                TheBomb.Draw(g);
                if (Form1.ActiveForm != null)
                {
                    if (TheBomb.Position.Y > Form1.ActiveForm.ClientRectangle.Height)
                    {
                        ActiveBomb = false;
                    }
                }
            }


            if ((ActiveBomb == false) && (Counter % kBombInterval == 0))
            {
                ActiveBomb         = true;
                TheBomb.Position.X = MovingBounds.X + MovingBounds.Width / 2;
                TheBomb.Position.Y = MovingBounds.Y + 5;
            }
        }