summaryrefslogtreecommitdiffhomepage
path: root/games/arkanoid.c
diff options
context:
space:
mode:
authorRay <[email protected]>2019-05-21 17:47:06 +0200
committerRay <[email protected]>2019-05-21 17:47:06 +0200
commit8b4f58b9e9d3deef9e1f1dfebece16a9aca1e62f (patch)
tree049e864ba695cc1a76fb29bf1c2785ce762e00a9 /games/arkanoid.c
parent0027868d1f4ba76043e1cdfbb5c172696ad0985b (diff)
downloadraylib-8b4f58b9e9d3deef9e1f1dfebece16a9aca1e62f.tar.gz
raylib-8b4f58b9e9d3deef9e1f1dfebece16a9aca1e62f.zip
Review sample games
Diffstat (limited to 'games/arkanoid.c')
-rw-r--r--games/arkanoid.c21
1 files changed, 8 insertions, 13 deletions
diff --git a/games/arkanoid.c b/games/arkanoid.c
index 2a4a2e53..f72d85b3 100644
--- a/games/arkanoid.c
+++ b/games/arkanoid.c
@@ -25,7 +25,6 @@
//----------------------------------------------------------------------------------
// Some Defines
//----------------------------------------------------------------------------------
-
#define PLAYER_MAX_LIFE 5
#define LINES_OF_BRICKS 5
#define BRICKS_PER_LINE 20
@@ -56,16 +55,16 @@ typedef struct Brick {
//------------------------------------------------------------------------------------
// Global Variables Declaration
//------------------------------------------------------------------------------------
-static int screenWidth = 800;
-static int screenHeight = 450;
+static const int screenWidth = 800;
+static const int screenHeight = 450;
-static bool gameOver;
-static bool pause;
+static bool gameOver = false;
+static bool pause = false;
-static Player player;
-static Ball ball;
-static Brick brick[LINES_OF_BRICKS][BRICKS_PER_LINE];
-static Vector2 brickSize;
+static Player player = { 0 };
+static Ball ball = { 0 };
+static Brick brick[LINES_OF_BRICKS][BRICKS_PER_LINE] = { 0 };
+static Vector2 brickSize = { 0 };
//------------------------------------------------------------------------------------
// Module Functions Declaration (local)
@@ -90,7 +89,6 @@ int main(void)
#if defined(PLATFORM_WEB)
emscripten_set_main_loop(UpdateDrawFrame, 0, 1);
#else
-
SetTargetFPS(60);
//--------------------------------------------------------------------------------------
@@ -103,7 +101,6 @@ int main(void)
//----------------------------------------------------------------------------------
}
#endif
-
// De-Initialization
//--------------------------------------------------------------------------------------
UnloadGame(); // Unload loaded data (textures, sounds, models...)
@@ -272,8 +269,6 @@ void UpdateGame(void)
gameOver = false;
}
}
-
-
}
// Draw game (one frame)