summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorBoredGuy <osome3717@gmail.com>2025-07-28 05:14:54 -0700
committerBoredGuy <osome3717@gmail.com>2025-07-28 05:14:54 -0700
commit9e1627c229d8d094c7b55751d82db9d3579a16e1 (patch)
treeb8623b5980e090b3faa91e55ed6f84cd1634b570 /include
parentdc3d98ab47fefc8388455dbbd4d330e81499d95a (diff)
Completed Basics
Diffstat (limited to 'include')
-rw-r--r--include/game.h17
-rw-r--r--include/physics.h5
-rw-r--r--include/player.h6
3 files changed, 26 insertions, 2 deletions
diff --git a/include/game.h b/include/game.h
index 9f44f46..64da8e7 100644
--- a/include/game.h
+++ b/include/game.h
@@ -10,7 +10,8 @@
#define ENTITY_PHYSICS_ACTIVE (1 << 2)
typedef enum EntityType {
- Player_Entity
+ Player_Entity,
+ Wall_Entity
} EntityType;
typedef struct Entity {
@@ -19,21 +20,33 @@ typedef struct Entity {
uint16_t flags;
Vector2 position;
+ Vector2 velocity;
//Physics information
- Rectangle collider;
+ Rectangle physicsCollider;
int numHitBoxes;
Rectangle hitBoxes[MAX_AREA_COUNT];
int numHurtBoxes;
Rectangle hurtBoxes[MAX_AREA_COUNT];
+
+ #ifdef BEATEMUP_DEBUG
+ //Debug information
+ Color physicsColliderColor;
+ #endif
} Entity;
typedef struct Game {
bool paused;
Entity entities[MAX_ENTITY_COUNT];
+
+ Texture2D background;
+ float backgroundPosition;
} Game;
+void AddEntity(Entity* e);
+void AddWall(float xpos, float ypos, float width, float height);
+
void InitGame();
void UpdateGame(float deltaTime);
void DrawGame(); \ No newline at end of file
diff --git a/include/physics.h b/include/physics.h
new file mode 100644
index 0000000..b393d08
--- /dev/null
+++ b/include/physics.h
@@ -0,0 +1,5 @@
+#pragma once
+
+#include "game.h"
+
+void MoveAndSlide(Entity* e, float dt); \ No newline at end of file
diff --git a/include/player.h b/include/player.h
new file mode 100644
index 0000000..bcd3326
--- /dev/null
+++ b/include/player.h
@@ -0,0 +1,6 @@
+#include <raylib.h>
+#include <raymath.h>
+#include "game.h"
+
+void UpdatePlayer(Entity* player, float deltaTime);
+void AddPlayer(float xpos, float ypos); \ No newline at end of file