From cbfe8b1ce1e7265e44b90c55681528210b0ce5d9 Mon Sep 17 00:00:00 2001 From: Reece Mackie <20544390+Rover656@users.noreply.github.com> Date: Thu, 25 Apr 2019 19:28:44 +0100 Subject: [PATCH] Restore original example. --- projects/VS2017.UWP/raylib.App.UWP/App.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/projects/VS2017.UWP/raylib.App.UWP/App.cpp b/projects/VS2017.UWP/raylib.App.UWP/App.cpp index 6f5cd6528..ef6f57926 100644 --- a/projects/VS2017.UWP/raylib.App.UWP/App.cpp +++ b/projects/VS2017.UWP/raylib.App.UWP/App.cpp @@ -38,8 +38,9 @@ void App::Update() ClearBackground(RAYWHITE); - //posX += gamepadAxisState[GAMEPAD_PLAYER1][GAMEPAD_XBOX_AXIS_LEFT_X] * 5; - //posY += gamepadAxisState[GAMEPAD_PLAYER1][GAMEPAD_XBOX_AXIS_LEFT_Y] * -5; + posX += GetGamepadAxisMovement(GAMEPAD_PLAYER1, GAMEPAD_XBOX_AXIS_LEFT_X) * 5; + posY += GetGamepadAxisMovement(GAMEPAD_PLAYER1, GAMEPAD_XBOX_AXIS_LEFT_Y) * -5; + DrawRectangle(posX, posY, 400, 100, RED); DrawLine(0, 0, GetScreenWidth(), GetScreenHeight(), BLUE); @@ -50,13 +51,13 @@ void App::Update() if (IsKeyDown(KEY_S)) DrawCircle(100, 100, 100, BLUE); - if (IsKeyPressed(KEY_A) || IsGamepadButtonPressed(0, GAMEPAD_XBOX_BUTTON_LEFT)) + if (IsKeyPressed(KEY_A)) { posX -= 50; EnableCursor(); } - if (IsKeyPressed(KEY_D) || IsGamepadButtonPressed(0, GAMEPAD_XBOX_BUTTON_RIGHT)) + if (IsKeyPressed(KEY_D)) { posX += 50; DisableCursor();