diff options
Diffstat (limited to 'include/game.h')
-rw-r--r-- | include/game.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/include/game.h b/include/game.h index ec44b3e..99529bf 100644 --- a/include/game.h +++ b/include/game.h @@ -37,6 +37,9 @@ typedef struct Sprite { DrawLayer layer; Rectangle destRect; //Destination rectangle relative to player position + bool flipX; + bool flipY; + int numAnimations; //Zero for static spritesx Animation animations[MAX_ANIMATIONS]; int currentAnimation; @@ -64,6 +67,9 @@ typedef struct Entity { //Debug information Color physicsColliderColor; #endif + + //Human entity information + int bodySpriteIndex; } Entity; typedef struct Game { @@ -77,15 +83,37 @@ typedef struct Game { #endif } Game; +//Entity Stuff void AddEntity(Entity* e); void AddWall(float xpos, float ypos, float width, float height); +//Game Stuff void InitGame(); void UpdateGame(float deltaTime); void DrawGame(); +//Sprite Stuff void UpdateCurrentSpriteAnimation(Sprite* sprite, float dt); void DrawEntitySprite(const Entity* e, int spriteIndex); +Rectangle GetSrcRectFromIndex +( + Texture texture, + int framesX, + int framesY, + int index +); + +typedef struct { + Texture texture; + int framesX; + int framesY; + int numFrames; + bool isLooping; + int* indices; + float* frameTimes; +} AnimationFromIndicesParams; + +Animation AnimationFromIndices(AnimationFromIndicesParams params); #ifdef BEATEMUP_DEBUG void DebugHighlights(const Entity* e); |