aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/clicky.c29
-rw-r--r--src/clicky.h25
2 files changed, 54 insertions, 0 deletions
diff --git a/src/clicky.c b/src/clicky.c
new file mode 100644
index 0000000..a1ab910
--- /dev/null
+++ b/src/clicky.c
@@ -0,0 +1,29 @@
+#include "clicky.h"
+#include "game.h"
+#include "assets.h"
+
+void updatePenguinLol(Game* game, Clicky* clicky)
+{
+
+}
+
+Clicky createPenguinLolClicky(Game* game)
+{
+ Clicky clicky;
+
+ clicky.animation = createAnimation(&game->assets.animations[PENGUIN_LOL_ANIMATION], ANIMATION_DEFAULT_DELAY);
+ clicky.texture = &clicky.animation.texture;
+ clicky.rect = (Rectangle){0.0, 0.0, 128.0, 128.0};
+
+ clicky.data = NULL;
+ clicky.updateCB = updatePenguinLol;
+
+ runAnimation(&clicky.animation);
+
+ return clicky;
+}
+
+void freePenginLolClicky(Clicky clicky)
+{
+ closeAnimation(&clicky.animation);
+}
diff --git a/src/clicky.h b/src/clicky.h
new file mode 100644
index 0000000..283b5c0
--- /dev/null
+++ b/src/clicky.h
@@ -0,0 +1,25 @@
+#include "gameCommon.h"
+#include "animation.h"
+
+#ifndef CLICKY_H
+#define CLICKY_H
+
+typedef struct Clicky Clicky;
+typedef void (*ClickyUpdateCB)(Game* game, Clicky* clicky);
+
+// A fixable clicky clicky. There shall be many clicky clickies.
+typedef struct Clicky {
+ Animation animation;
+ Texture* texture;
+ Rectangle rect;
+
+ void* data;
+ ClickyUpdateCB updateCB;
+} Clicky;
+
+// A silly silly penguin lol.
+Clicky createPenguinLolClicky(Game* game);
+void freePenginLolClicky(Clicky clicky);
+
+#endif
+