From 5ecb6801fa5bf4f59a4459adfda922169523567f Mon Sep 17 00:00:00 2001 From: raysan5 Date: Sun, 21 Sep 2014 14:26:42 +0200 Subject: Examples renaming and test examples merge Examples have been renamed for coherence with raylib modules and test examples have been merged into examples folder. --- examples/core_input_gamepad.c | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) (limited to 'examples/core_input_gamepad.c') 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 -- cgit v1.2.3