Ejemplo n.º 1
0
        // Both below functions error out when given time to load
        public void OnEnd()
        {
            gameTimer.Enabled = false;

            Form f = this.FindForm();

            f.Controls.Remove(this);

            GameOverScreen gos = new GameOverScreen();

            f.Controls.Add(gos);

            gos.Focus();
        }
Ejemplo n.º 2
0
        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();
        }