summaryrefslogtreecommitdiffhomepage
path: root/examples/physac/physics_friction.c
diff options
context:
space:
mode:
authorDarkElvenAngel <[email protected]>2019-06-10 16:12:06 -0400
committerGitHub <[email protected]>2019-06-10 16:12:06 -0400
commitd7f4be071579e6f00974c0940f021272f22fbc54 (patch)
tree6ee389e6617c494d272e9bc82415fbc3618e7a28 /examples/physac/physics_friction.c
parent8a21830b77eaa76ffe0c31df5f96aecd6bd2eecc (diff)
parentbaf7d7d19ad8d6bfbfc201169e4ed4f49a9576a6 (diff)
downloadraylib-d7f4be071579e6f00974c0940f021272f22fbc54.tar.gz
raylib-d7f4be071579e6f00974c0940f021272f22fbc54.zip
Merge pull request #1 from raysan5/master
Update
Diffstat (limited to 'examples/physac/physics_friction.c')
-rw-r--r--examples/physac/physics_friction.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/examples/physac/physics_friction.c b/examples/physac/physics_friction.c
index 337a1265..0acf88ae 100644
--- a/examples/physac/physics_friction.c
+++ b/examples/physac/physics_friction.c
@@ -10,7 +10,7 @@
* gcc -o $(NAME_PART).exe $(FILE_NAME) -s -static /
* -lraylib -lpthread -lglfw3 -lopengl32 -lgdi32 -lopenal32 -lwinmm /
* -std=c99 -Wl,--subsystem,windows -Wl,-allow-multiple-definition
-*
+*
* Copyright (c) 2016-2018 Victor Fisac
*
********************************************************************************************/
@@ -21,12 +21,12 @@
#define PHYSAC_NO_THREADS
#include "physac.h"
-int main()
+int main(void)
{
// Initialization
//--------------------------------------------------------------------------------------
- int screenWidth = 800;
- int screenHeight = 450;
+ const int screenWidth = 800;
+ const int screenHeight = 450;
SetConfigFlags(FLAG_MSAA_4X_HINT);
InitWindow(screenWidth, screenHeight, "Physac [raylib] - Physics friction");
@@ -61,11 +61,11 @@ int main()
SetPhysicsBodyRotation(bodyA, 30*DEG2RAD);
PhysicsBody bodyB = CreatePhysicsBodyRectangle((Vector2){ screenWidth - 35, screenHeight*0.6f }, 40, 40, 10);
- bodyB->staticFriction = 1;
- bodyB->dynamicFriction = 1;
+ bodyB->staticFriction = 1.0f;
+ bodyB->dynamicFriction = 1.0f;
SetPhysicsBodyRotation(bodyB, 330*DEG2RAD);
- SetTargetFPS(60);
+ SetTargetFPS(60); // Set our game to run at 60 frames-per-second
//--------------------------------------------------------------------------------------
// Main game loop
@@ -82,7 +82,7 @@ int main()
bodyA->velocity = (Vector2){ 0, 0 };
bodyA->angularVelocity = 0;
SetPhysicsBodyRotation(bodyA, 30*DEG2RAD);
-
+
bodyB->position = (Vector2){ screenWidth - 35, screenHeight*0.6f };
bodyB->velocity = (Vector2){ 0, 0 };
bodyB->angularVelocity = 0;
@@ -137,9 +137,9 @@ int main()
}
// De-Initialization
- //--------------------------------------------------------------------------------------
+ //--------------------------------------------------------------------------------------
ClosePhysics(); // Unitialize physics
-
+
CloseWindow(); // Close window and OpenGL context
//--------------------------------------------------------------------------------------