Пример #1
0
        public static void paint(Playground _actPlayground)
        {
            Font       drawFont  = new Font("Arial", 13);
            SolidBrush drawBrush = new SolidBrush(Color.Red);

            try
            {
                myBuffer = currentContext.Allocate(_actPlayground.CreateGraphics(), _actPlayground.DisplayRectangle);
                foreach (Feld field in Engine.FieldMap_2D)
                {
                    myBuffer.Graphics.DrawImage(field.getBMap(), field.getStartPoint());
                }

                foreach (Kiste obj in Engine.holder)
                {
                    myBuffer.Graphics.DrawImage(obj.getBMap(), obj.getStartPoint());
                }

                myBuffer.Graphics.DrawImage(_actPlayground._spieler.getBMap(), _actPlayground._spieler.getActPoint());

                //moves and shifts
                myBuffer.Graphics.DrawString("Moves " + Engine.moves, drawFont, drawBrush, new PointF(5, 30));
                myBuffer.Graphics.DrawString("Shifts " + Engine.shifts, drawFont, drawBrush, new PointF(150, 30));

                myBuffer.Render();
            }
            catch (NullReferenceException ex)
            {
                System.Diagnostics.Debug.WriteLine(ex.Message);
                _actPlayground.timer1.Stop();
            }
        }
Пример #2
0
 public static void Main(String[] args)
 {
     Application.EnableVisualStyles();
     Application.SetCompatibleTextRenderingDefault(false);
     Playground p = new Playground();
     Engine.setPlayground(p);
     Engine.Start();
     //do anything
     p.BringToFront();
     p.Focus();
     Application.Run(p);
 }
Пример #3
0
        //public Engine(ref object[] holder, ref Feld[,] FieldMap_2D)
        //{
        //    this.holder = holder;
        //    this.FieldMap_2D = FieldMap_2D;
        //}

        public static void setPlayground(Playground _playground)
        {
            Playground = _playground;
        }