private void OnKeyDown(Event e) { if (IsGoalOnScreen) { return; } var key = e.As <KeyboardEvent>().GetKey(); switch (key) { case Key.Up: isMoving = true; caveMan.GotoAndPlay(1); break; case Key.Left: if (!isRotating) { isRotating = true; rotation = Direction.Left; } break; case Key.Right: if (!isRotating) { isRotating = true; rotation = Direction.Right; } break; default: return; } }