formatting
This commit is contained in:
parent
d1e4f42fbb
commit
1bd7722557
|
|
@ -57,11 +57,13 @@ int main(void)
|
||||||
stackSpacing = Clamp(stackSpacing, 0.0f, 5.0f);
|
stackSpacing = Clamp(stackSpacing, 0.0f, 5.0f);
|
||||||
|
|
||||||
// Add a positive/negative offset to spin right/left at different speeds
|
// Add a positive/negative offset to spin right/left at different speeds
|
||||||
if (IsKeyDown(KEY_LEFT) || IsKeyDown(KEY_A)) {
|
if (IsKeyDown(KEY_LEFT) || IsKeyDown(KEY_A))
|
||||||
|
{
|
||||||
rotationSpeed -= speedChange;
|
rotationSpeed -= speedChange;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (IsKeyDown(KEY_RIGHT) || IsKeyDown(KEY_D)) {
|
if (IsKeyDown(KEY_RIGHT) || IsKeyDown(KEY_D))
|
||||||
|
{
|
||||||
rotationSpeed += speedChange;
|
rotationSpeed += speedChange;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -82,7 +84,8 @@ int main(void)
|
||||||
float scaledHeight = frameHeight*stackScale;
|
float scaledHeight = frameHeight*stackScale;
|
||||||
|
|
||||||
// Draw the stacked sprite, rotated to the correct angle, with an vertical offset applied based on its y location
|
// Draw the stacked sprite, rotated to the correct angle, with an vertical offset applied based on its y location
|
||||||
for (int i = stackCount - 1; i >= 0; i--) {
|
for (int i = stackCount - 1; i >= 0; i--)
|
||||||
|
{
|
||||||
Rectangle source = { 0.0f, (float)i*frameHeight, frameWidth, frameHeight };
|
Rectangle source = { 0.0f, (float)i*frameHeight, frameWidth, frameHeight };
|
||||||
// Center vertically
|
// Center vertically
|
||||||
Rectangle dest = { screenWidth/2.0f, (screenHeight/2.0f) + (i*stackSpacing) - (stackSpacing*stackCount/2.0f), scaledWidth, scaledHeight };
|
Rectangle dest = { screenWidth/2.0f, (screenHeight/2.0f) + (i*stackSpacing) - (stackSpacing*stackCount/2.0f), scaledWidth, scaledHeight };
|
||||||
|
|
@ -103,7 +106,6 @@ int main(void)
|
||||||
|
|
||||||
// De-Initialization
|
// De-Initialization
|
||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
|
|
||||||
UnloadTexture(booth);
|
UnloadTexture(booth);
|
||||||
|
|
||||||
CloseWindow(); // Close window and OpenGL context
|
CloseWindow(); // Close window and OpenGL context
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user