Ejemplo n.º 1
0
        public static void Draw()
        {
            buffer.Graphics.Clear(Color.Black);

            foreach (SpaceElement se in stars)
            {
                Point p;
                buffer.Graphics.DrawImage(se.draw(out p), p);
            }

            buffer.Graphics.DrawImage(new Bitmap(Resources.planet, new Size(200, 200)), 100, 100);

            foreach (asteroid se in asteroids)
            {
                Point P;
                bool  hit;
                buffer.Graphics.DrawImage(se.draw(out P, out hit), P);
                if (hit)
                {
                    crack cr = new crack(P);
                    cracks.Add(cr);
                }
            }

            foreach (crack cr in cracks)
            {
                Point P;
                buffer.Graphics.DrawImage(cr.draw(out P), P);
            }
            buffer.Render();
        }
Ejemplo n.º 2
0
        public static void Draw()
        {
            buffer.Graphics.Clear(Color.Black);
            Point p;

            foreach (Star se in stars)
            {
                buffer.Graphics.DrawImage(se.draw(out p), p);
            }

            buffer.Graphics.DrawImage(new Bitmap(Resources.planet, new Size(200, 200)), 100, 100);


            foreach (asteroid se in asteroids)
            {
                //bool hit;
                if (se != null)
                {
                    buffer.Graphics.DrawImage(se.draw(out p), p);
                    if (se.Hit)
                    {
                        crack cr = new crack(p);
                        cracks.Add(cr);
                    }
                }
            }

            foreach (crack cr in cracks)
            {
                buffer.Graphics.DrawImage(cr.draw(out p), p);
            }

            //if (bullet != null)
            foreach (Bullet bullet in queue)
            {
                buffer.Graphics.DrawImage(bullet.draw(out p), p);
            }

            aim(new Point(400, 300));
            buffer.Render();
        }