aboutsummaryrefslogtreecommitdiffstats
path: root/src/animation.h
diff options
context:
space:
mode:
authornathansmith117 <thenathansmithsmith@gmail.com>2024-02-15 00:06:35 +0000
committernathansmith117 <thenathansmithsmith@gmail.com>2024-02-15 00:06:35 +0000
commit64bb931e18825b285dd93d0b9987ef72ece15ab4 (patch)
tree78cee060cf5f4f2bcc99254c99cead6f2d77578e /src/animation.h
parentadf3b7635326af20e0e77d37c080ef08c64e9e91 (diff)
downloadPenguinYippies-64bb931e18825b285dd93d0b9987ef72ece15ab4.tar.gz
PenguinYippies-64bb931e18825b285dd93d0b9987ef72ece15ab4.tar.bz2
PenguinYippies-64bb931e18825b285dd93d0b9987ef72ece15ab4.zip
Working on animation stuff
Diffstat (limited to 'src/animation.h')
-rw-r--r--src/animation.h25
1 files changed, 25 insertions, 0 deletions
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