diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/assets.h | 6 | ||||
-rw-r--r-- | include/background.h | 7 | ||||
-rw-r--r-- | include/game.h | 20 |
3 files changed, 31 insertions, 2 deletions
diff --git a/include/assets.h b/include/assets.h new file mode 100644 index 0000000..e2d76b7 --- /dev/null +++ b/include/assets.h @@ -0,0 +1,6 @@ +#pragma once + +#include <raylib.h> + +void LoadAssets(); +Texture2D GetTexture(const char* name); diff --git a/include/background.h b/include/background.h new file mode 100644 index 0000000..104db7c --- /dev/null +++ b/include/background.h @@ -0,0 +1,7 @@ +#pragma once + +#include "game.h" +#include "assets.h" + +void AddBackground(const char* backgroundTexture); +void UpdateBackground(Entity* background, float deltaTime); diff --git a/include/game.h b/include/game.h index 64da8e7..1039ad5 100644 --- a/include/game.h +++ b/include/game.h @@ -1,6 +1,7 @@ #pragma once #include <raylib.h> +#include <stdbool.h> #include <stdint.h> #include "constants.h" @@ -11,9 +12,15 @@ typedef enum EntityType { Player_Entity, - Wall_Entity + Wall_Entity, + Background_Entity } EntityType; +typedef enum DrawLayer { + Background_Layer = 0, + Foreground_Layer = 1 +} DrawLayer; + typedef struct Entity { int id; EntityType type; @@ -29,6 +36,11 @@ typedef struct Entity { int numHurtBoxes; Rectangle hurtBoxes[MAX_AREA_COUNT]; + //Graphics Information + Texture2D texture; + DrawLayer drawLayer; + Rectangle destRect; //Relative to the players position + #ifdef BEATEMUP_DEBUG //Debug information Color physicsColliderColor; @@ -42,6 +54,10 @@ typedef struct Game { Texture2D background; float backgroundPosition; + #ifdef BEATEMUP_DEBUG + //Debug information + bool enableDebugOverlay; + #endif } Game; void AddEntity(Entity* e); @@ -49,4 +65,4 @@ void AddWall(float xpos, float ypos, float width, float height); void InitGame(); void UpdateGame(float deltaTime); -void DrawGame();
\ No newline at end of file +void DrawGame(); |