Ejemplo n.º 1
0
 public Window()
 {
     InitializeComponent();
     B = new Bitmap(448, 448);
     G = Graphics.FromImage(B);
     G.Clear(Color.Wheat);
     gamePicture.Image = B;
     game = new Game();
     game.Draw(G);
     gamePicture.Invalidate();
 }
Ejemplo n.º 2
0
        private void UpdateUI()
        {
            stepCounter.Text = game.moves.Count.ToString();
            levelLabel.Text  = "LEVEL " + game.CurrentLevel.ToString();

            G.Clear(Color.Wheat);
            game.Draw(G);
            gamePicture.Invalidate();
            if (game.CheckSuccess())
            {
                if (game.CurrentLevel == Game.MAX_LEVEL)
                {
                    ToogleWinMessage();
                }
                else
                {
                    nextLevelLabel.Visible = true;
                }
            }
        }
Ejemplo n.º 3
0
 private void pictureBox1_Paint(object sender, PaintEventArgs e)
 {
     game.Draw(new Painter(e.Graphics));
 }