diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/game.h | 17 | ||||
-rw-r--r-- | include/physics.h | 5 | ||||
-rw-r--r-- | include/player.h | 6 |
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 |