예제 #1
0
        private void KeyDown_Listner(object sender, KeyEventArgs e)
        {
            if (onlinehost == true || online == false)
            {
                tank1.SetDirection(e, true);
            }

            if (onlinehost == false || online == false)
            {
                tank2.SetDirection(e, true);
            }

            if (e.KeyCode == Keys.Escape)
            {
                Timers_off();
                gameTimer.Enabled = false;
                disconect         = true;
                if (online)
                {
                    SocketConnect.SendTimer();
                    online = false;
                }
                Application.Restart();
            }
        }
예제 #2
0
 private void timerSend_Tick(object sender, EventArgs e)
 {
     if (timersOff == true)
     {
         timersOff         = false;
         timerHost.Enabled = false;
         timerSend.Enabled = false;
         gameTimer.Enabled = false;
     }
     if (onlinehost && listBonus.Count < 1)
     {
         bonusLocation = (byte)Initialise.random.Next(0, listSwamp.Count - 1); // Przyszła lokacja bonusu
     }
     SocketConnect.SendTimer();
 }