From 815aec62f8ae3a403e913559d5fe6138c8825007 Mon Sep 17 00:00:00 2001 From: BoredGuy Date: Tue, 29 Jul 2025 11:50:57 +0300 Subject: Added background entity and asset system --- include/game.h | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'include/game.h') 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 +#include #include #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(); -- cgit v1.2.3