private void Form1_KeyDown(object sender, KeyEventArgs e) { switch (e.KeyCode) { case Keys.Space: StickTimer.Start(); break; } }
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; } }
protected override void OnNavigatedFrom(NavigationEventArgs e) { if (StickTimer != null) { if (StickTimer.IsEnabled) { StickTimer.Stop(); } StickTimer = null; } if (socket != null) { socket.Dispose(); socket = null; } }