public void OnEnd() { //Testing: Saving the scores saveScoresRK(); // Goes to the game over screen //Form1 form = FindForm() as Form1; //form.ChangeScreen(this, new MenuScreen()); GameOverScreen gos = new GameOverScreen(); Form form = this.FindForm(); form.Controls.Add(gos); form.Controls.Remove(this); gos.Location = new Point((form.Width - gos.Width) / 2, (form.Height - gos.Height) / 2); }
public void OnWin() { gameTimer.Stop(); win = true; Form f = this.FindForm(); f.Controls.Remove(this); GameOverScreen gos = new GameOverScreen(); f.Controls.Add(gos); gos.Location = new Point((f.Width - gos.Width) / 2, (f.Height - gos.Height) / 2); gos.Focus(); }