From 64bb931e18825b285dd93d0b9987ef72ece15ab4 Mon Sep 17 00:00:00 2001 From: nathansmith117 Date: Wed, 14 Feb 2024 17:06:35 -0700 Subject: Working on animation stuff --- src/animation.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 src/animation.h (limited to 'src/animation.h') diff --git a/src/animation.h b/src/animation.h new file mode 100644 index 0000000..8ec918f --- /dev/null +++ b/src/animation.h @@ -0,0 +1,25 @@ +#include "gameCommon.h" + +#define ANIMATION_DEFAULT_DELAY 0.1 + +#ifndef ANIMATION_H +#define ANIMATION_H + +typedef struct Animation { + // Frame stuff. + int frameCount; + int currentFrame; + + // The animation is stored in a image and the texture is used for fast rendering. + Image image; + Texture texture; + + // Timing the frames. + double delay; + double lastTime; +} Animation; + +Animation loadAnimationFromFile(const char* fileName); +void freeAnimation(Animation* animation); + +#endif -- cgit v1.2.3