aboutsummaryrefslogtreecommitdiff
path: root/src/gameScreen.c
diff options
context:
space:
mode:
authornathansmithsmith <thenathansmithsmith@gmail.com>2023-07-20 03:08:57 -0600
committernathansmithsmith <thenathansmithsmith@gmail.com>2023-07-20 03:08:57 -0600
commit43e31b6e124da754ef928d22fbb9a1d7640aab4b (patch)
tree698f723866bd99982a6c606c63cfa0387863e2db /src/gameScreen.c
parentf3f5fedbf591c10fa675a32103bab9480b42abe8 (diff)
New bullet system
Diffstat (limited to 'src/gameScreen.c')
-rw-r--r--src/gameScreen.c31
1 files changed, 25 insertions, 6 deletions
diff --git a/src/gameScreen.c b/src/gameScreen.c
index 286a026..65b020c 100644
--- a/src/gameScreen.c
+++ b/src/gameScreen.c
@@ -3,27 +3,46 @@
#include "world.h"
#include "bullets.h"
+void drawCrossHair(float size, float thick, Color color) {
+ Vector3 center = (Vector3){GetScreenWidth() / 2.0, GetScreenHeight() / 2.0};
+
+ // Left to right.
+ DrawLineEx(
+ (Vector2){center.x - size, center.y},
+ (Vector2){center.x + size, center.y},
+ thick,
+ color
+ );
+
+ // Top to bottom.
+ DrawLineEx(
+ (Vector2){center.x, center.y - size},
+ (Vector2){center.x, center.y + size},
+ thick,
+ color
+ );
+}
+
void updateGameScreen(Game * game) {
+ ClearBackground(BLACK);
+
+ // Draw cross hair.
+ drawCrossHair(10.0, 2.0, BLUE);
// Update world.
updateWorld(&game->world, game);
- ClearBackground(BLACK);
-
// Camera.
updatePlayerCamera(&game->playerCamera, game);
+ // Draw.
BeginMode3D(game->playerCamera);
DrawGrid(50, 25.0);
- //DrawSphereWires(Vector3Zero(), GAME_BOUNDS, 32, 32, WHITE);
-
// Draw world.
drawWorld(&game->world, game);
- updateBullets(game, &game->bullets);
-
EndMode3D();
}