Exemple #1
0
 private void Form1_KeyDown(object sender, KeyEventArgs e)
 {
     switch (e.KeyCode)
     {
     case Keys.Space:
         StickTimer.Start();
         break;
     }
 }
Exemple #2
0
        private void Form1_KeyUp(object sender, KeyEventArgs e)
        {
            switch (e.KeyCode)
            {
            case Keys.Space:
                int destinationToNextPlatform;
                StickTimer.Stop();
                StickHeroField.Refresh();
                StickDropTimer.Start();
                destinationToNextPlatform = GetDestination(_stickStartPoint.X, _nextPlatform.PositionPoint.X);
                _stickHeroGame.CheckStickSize(_currentStickSize, destinationToNextPlatform, _nextPlatform.GetWidth());

                break;
            }
        }
Exemple #3
0
 protected override void OnNavigatedFrom(NavigationEventArgs e)
 {
     if (StickTimer != null)
     {
         if (StickTimer.IsEnabled)
         {
             StickTimer.Stop();
         }
         StickTimer = null;
     }
     if (socket != null)
     {
         socket.Dispose();
         socket = null;
     }
 }