diff options
| author | raysan5 <raysan5@gmail.com> | 2014-09-21 14:26:42 +0200 |
|---|---|---|
| committer | raysan5 <raysan5@gmail.com> | 2014-09-21 14:26:42 +0200 |
| commit | 5ecb6801fa5bf4f59a4459adfda922169523567f (patch) | |
| tree | 0516a772c0efaccfb9980b5d6620b903ffddc1b2 /examples/core_input_gamepad.c | |
| parent | 3a0d164a768a7c4ec1e5f56ddfc005182f8a86eb (diff) | |
| download | raylib-5ecb6801fa5bf4f59a4459adfda922169523567f.tar.gz raylib-5ecb6801fa5bf4f59a4459adfda922169523567f.zip | |
Examples renaming and test examples merge
Examples have been renamed for coherence with raylib modules and test
examples have been merged into examples folder.
Diffstat (limited to 'examples/core_input_gamepad.c')
| -rw-r--r-- | examples/core_input_gamepad.c | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/examples/core_input_gamepad.c b/examples/core_input_gamepad.c index 6b883b42..9ce5b6ff 100644 --- a/examples/core_input_gamepad.c +++ b/examples/core_input_gamepad.c @@ -1,11 +1,14 @@ /******************************************************************************************* * -* raylib example 03c - Gamepad input +* raylib [core] example - Gamepad input +* +* NOTE: This example requires a Gamepad connected to the system +* raylib is configured to work with Xbox 360 gamepad, check raylib.h for buttons configuration * * This example has been created using raylib 1.0 (www.raylib.com) * raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details) * -* Copyright (c) 2013 Ramon Santamaria (Ray San - raysan@raysanweb.com) +* Copyright (c) 2014 Ramon Santamaria (Ray San - raysan@raysanweb.com) * ********************************************************************************************/ @@ -18,12 +21,12 @@ int main() int screenWidth = 800; int screenHeight = 450; - Vector2 ballPosition = { screenWidth/2, screenHeight/2 }; - Vector2 gamepadMove = { 0, 0 }; - - InitWindow(screenWidth, screenHeight, "raylib example 01 - gamepad input"); + InitWindow(screenWidth, screenHeight, "raylib [core] example - gamepad input"); - SetTargetFPS(60); // Set target frames-per-second + Vector2 ballPosition = { screenWidth/2, screenHeight/2 }; + Vector2 gamepadMovement = { 0, 0 }; + + SetTargetFPS(60); // Set target frames-per-second //-------------------------------------------------------------------------------------- // Main game loop @@ -33,10 +36,10 @@ int main() //---------------------------------------------------------------------------------- if (IsGamepadAvailable(GAMEPAD_PLAYER1)) { - gamepadMove = GetGamepadMovement(GAMEPAD_PLAYER1); + gamepadMovement = GetGamepadMovement(GAMEPAD_PLAYER1); - ballPosition.x += gamepadMove.x; - ballPosition.y -= gamepadMove.y; + ballPosition.x += gamepadMovement.x; + ballPosition.y -= gamepadMovement.y; if (IsGamepadButtonPressed(GAMEPAD_PLAYER1, GAMEPAD_BUTTON_A)) { @@ -66,4 +69,4 @@ int main() //-------------------------------------------------------------------------------------- return 0; -} +}
\ No newline at end of file |
