summaryrefslogtreecommitdiffhomepage
path: root/examples/web/physac/physics_movement.c
diff options
context:
space:
mode:
Diffstat (limited to 'examples/web/physac/physics_movement.c')
-rw-r--r--examples/web/physac/physics_movement.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/examples/web/physac/physics_movement.c b/examples/web/physac/physics_movement.c
index 70078b0..d7a2f7d 100644
--- a/examples/web/physac/physics_movement.c
+++ b/examples/web/physac/physics_movement.c
@@ -7,9 +7,9 @@
*
* Use the following line to compile:
*
-* gcc -o $(NAME_PART).exe $(FILE_NAME) -s $(RAYLIB_DIR)\raylib\raylib_icon -static -lraylib -lpthread
+* gcc -o $(NAME_PART).exe $(FILE_NAME) -s $(RAYLIB_DIR)\raylib\raylib_icon -static -lraylib -lpthread
* -lglfw3 -lopengl32 -lgdi32 -lopenal32 -lwinmm -std=c99 -Wl,--subsystem,windows -Wl,-allow-multiple-definition
-*
+*
* Copyright (c) 2017 Victor Fisac
*
********************************************************************************************/
@@ -28,14 +28,14 @@
//----------------------------------------------------------------------------------
// Global Variables Definition
//----------------------------------------------------------------------------------
-int screenWidth = 800;
-int screenHeight = 450;
+const int screenWidth = 800;
+const int screenHeight = 450;
// Physac logo drawing position
int logoX = 0;
int logoY = 15;
-PhysicsBody body;
+PhysicsBody body = { 0 };
//----------------------------------------------------------------------------------
// Module Functions Declaration
@@ -43,9 +43,9 @@ PhysicsBody body;
void UpdateDrawFrame(void); // Update and Draw one frame
//----------------------------------------------------------------------------------
-// Main Enry Point
+// Program Main Entry Point
//----------------------------------------------------------------------------------
-int main()
+int main(void)
{
// Initialization
//--------------------------------------------------------------------------------------
@@ -76,13 +76,13 @@ int main()
body = CreatePhysicsBodyRectangle((Vector2){ screenWidth/2, screenHeight/2 }, 50, 50, 1);
body->freezeOrient = true; // Constrain body rotation to avoid little collision torque amounts
-
+
#if defined(PLATFORM_WEB)
emscripten_set_main_loop(UpdateDrawFrame, 0, 1);
#else
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
//--------------------------------------------------------------------------------------
-
+
// Main game loop
while (!WindowShouldClose()) // Detect window close button or ESC key
{
@@ -91,7 +91,7 @@ int main()
#endif
// De-Initialization
- //--------------------------------------------------------------------------------------
+ //--------------------------------------------------------------------------------------
ClosePhysics(); // Uninitialize physics
CloseWindow(); // Close window and OpenGL context