Пример #1
0
        private void gameTimer_Tick(object sender, EventArgs e)
        {
            //  && watch.Elapsed.TotalMilliseconds >= 500

            //while (serialPort1.IsOpen) {

            try {
                int act = serialPort1.ReadChar();
                if (act.Equals('w') && watch.Elapsed.TotalMilliseconds >= 500)
                {
                    startScreen gameScreen = new startScreen();
                    gameScreen.Show();
                    //gameOn = true;
                    watch.Restart();
                    //gameTimer.Stop();
                    //this.Close();

                    serialPort1.Close();
                    serialPort2.Close();
                }
                else if (act.Equals('x') && watch.Elapsed.TotalMilliseconds >= 500)
                {
                    help helpScreen = new help();
                    helpScreen.Show();
                    watch.Restart();
                }
                //Thread.Sleep(500);
            }
            catch (Exception ex)
            {
            }
        }
Пример #2
0
        private void showInstructions(object sender, EventArgs e)
        {
            help helpScreen = new help();

            helpScreen.Show();
        }