public MainForm() { InitializeComponent(); this.TimerLoop.Interval = 20; jogo = new JogoBricks(this.pictureBox1.Width, pictureBox1.Height, 0); this.pictureBox1.Image = jogo.RenderFrame(); }
private void MainFormTeclas(object sender, KeyPressEventArgs e) { if (this.jogo == null) { return; } if (e.KeyChar == 'p' || e.KeyChar == 'P' && this.jogo.Status != JogoBricks.GameStatus.ENDED) { this.jogo.Pausa(); this.TimerLoop.Start(); } if (this.pictureBox1.Image != null) { this.pictureBox1.Image.Dispose(); } this.pictureBox1.Image = jogo.RenderFrame(); }