Esempio n. 1
0
        private void Grid_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (e.KeyChar.ToString().ToLower() == "r")
            {
                game.ResetUniverse();
                game.SetRandomAlive();
                this.Invalidate();
            }
            if (e.KeyChar.ToString().ToLower() == "s")
            {
                aTimer.Start();
                GameIsOn = true;
            }
            if (e.KeyChar.ToString().ToLower() == "e")
            {
                aTimer.Stop();
                GameIsOn = false;

                game.ResetUniverse();

                this.Invalidate();
            }
        }