summaryrefslogtreecommitdiff
path: root/include/game.h
diff options
context:
space:
mode:
authorBoredGuy <osome3717@gmail.com>2025-08-07 10:10:18 +0300
committerBoredGuy <osome3717@gmail.com>2025-08-07 10:10:18 +0300
commit251be1ac2d808dfd0fca5c0eb37398357ca7bb20 (patch)
tree4bc7ccdaee4773b1ef55ce734a40c528384d4efe /include/game.h
parent2b95f565e8b88841d20f79205ac600cc14e28458 (diff)
Huge Commit
- Added (static)sprites - Removed variable fps (removes wierd camera jitter) Also I'm becoming increasingly more anti-VSync
Diffstat (limited to 'include/game.h')
-rw-r--r--include/game.h19
1 files changed, 15 insertions, 4 deletions
diff --git a/include/game.h b/include/game.h
index fbfe2e1..e54afd3 100644
--- a/include/game.h
+++ b/include/game.h
@@ -21,6 +21,12 @@ typedef enum DrawLayer {
Foreground_Layer = 1
} DrawLayer;
+typedef struct Sprite {
+ Texture2D texture;
+ DrawLayer layer;
+ Rectangle destRect; //Destination rectangle relative to player position
+} Sprite;
+
typedef struct Entity {
int id;
EntityType type;
@@ -36,10 +42,8 @@ typedef struct Entity {
int numHurtBoxes;
Rectangle hurtBoxes[MAX_AREA_COUNT];
- //Graphics Information
- Texture2D texture;
- DrawLayer drawLayer;
- Rectangle destRect; //Relative to the players position
+ Sprite sprites[MAX_SPRITE_COUNT];
+ int numSprites;
#ifdef BEATEMUP_DEBUG
//Debug information
@@ -73,6 +77,13 @@ static inline bool SameEntity(const Entity* a, const Entity* b) {
return a->id == b->id;
}
+static inline void AddSpriteToEntity(Entity* e, Sprite s) {
+ if (e->numSprites < MAX_SPRITE_COUNT) {
+ e->sprites[e->numSprites++] = s;
+ }
+}
+
+
#ifdef BEATEMUP_DEBUG
void DebugHighlights(const Entity* e);
#endif