Code cleaning, removed useless spaces
This commit is contained in:
parent
e2ff32eb84
commit
51688c004c
30 changed files with 395 additions and 395 deletions
|
@ -20,15 +20,15 @@ int main()
|
|||
//--------------------------------------------------------------------------------------
|
||||
int screenWidth = 800;
|
||||
int screenHeight = 450;
|
||||
|
||||
|
||||
InitWindow(screenWidth, screenHeight, "raylib [core] example - gamepad input");
|
||||
|
||||
|
||||
Vector2 ballPosition = { screenWidth/2, screenHeight/2 };
|
||||
Vector2 gamepadMovement = { 0, 0 };
|
||||
|
||||
SetTargetFPS(60); // Set target frames-per-second
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
// Main game loop
|
||||
while (!WindowShouldClose()) // Detect window close button or ESC key
|
||||
{
|
||||
|
@ -37,10 +37,10 @@ int main()
|
|||
if (IsGamepadAvailable(GAMEPAD_PLAYER1))
|
||||
{
|
||||
gamepadMovement = GetGamepadMovement(GAMEPAD_PLAYER1);
|
||||
|
||||
|
||||
ballPosition.x += gamepadMovement.x;
|
||||
ballPosition.y -= gamepadMovement.y;
|
||||
|
||||
|
||||
if (IsGamepadButtonPressed(GAMEPAD_PLAYER1, GAMEPAD_BUTTON_A))
|
||||
{
|
||||
ballPosition.x = screenWidth/2;
|
||||
|
@ -48,17 +48,17 @@ int main()
|
|||
}
|
||||
}
|
||||
//----------------------------------------------------------------------------------
|
||||
|
||||
|
||||
// Draw
|
||||
//----------------------------------------------------------------------------------
|
||||
BeginDrawing();
|
||||
|
||||
|
||||
ClearBackground(RAYWHITE);
|
||||
|
||||
|
||||
DrawText("move the ball with gamepad", 10, 10, 20, DARKGRAY);
|
||||
|
||||
|
||||
DrawCircleV(ballPosition, 50, MAROON);
|
||||
|
||||
|
||||
EndDrawing();
|
||||
//----------------------------------------------------------------------------------
|
||||
}
|
||||
|
@ -67,6 +67,6 @@ int main()
|
|||
//--------------------------------------------------------------------------------------
|
||||
CloseWindow(); // Close window and OpenGL context
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue