private void OnKeyUp(Event e) { if (IsGoalOnScreen) { return; } var key = e.As <KeyboardEvent>().GetKey(); switch (key) { case Key.Up: isMoving = false; caveMan.GotoAndStop(0); break; case Key.Left: if (isRotating && rotation == Direction.Left) { isRotating = false; } break; case Key.Right: if (isRotating && rotation == Direction.Right) { isRotating = false; } break; default: return; } }