Exemple #1
0
 private void OnKeyDown()
 {
     Input = new Input();
     if (!Input.InputAvaliable)
     {
         return;
     }
     if (!Input.Quit())
     {
         GameIsPlaying = Input.Quit();
     }
     else if (Input.Pause())
     {
         Paused = !Paused;
     }
     else if (Input.Up(Direction))
     {
         Direction.SetDirectionUp();
     }
     else if (Input.Down(Direction))
     {
         Direction.SetDirectionDown();
     }
     else if (Input.Left(Direction))
     {
         Direction.SetDirectionLeft();
     }
     else if (Input.Right(Direction))
     {
         Direction.SetDirectionRight();
     }
 }