summaryrefslogtreecommitdiff
path: root/themes/src/spring/spring_theme.hpp
diff options
context:
space:
mode:
authorMatt Kosarek <matt.kosarek@canonical.com>2025-12-29 09:34:00 -0500
committerMatt Kosarek <matt.kosarek@canonical.com>2025-12-29 09:34:00 -0500
commitbf4b3a5c35152c1292757134123b3363d0f81bf6 (patch)
tree7796e03d309c43115596f78d553a74f911f82218 /themes/src/spring/spring_theme.hpp
parent25c93a0ab9c855f75ee48df635fb5422c8eaba95 (diff)
Renamed PascalCase files to snake_case
Diffstat (limited to 'themes/src/spring/spring_theme.hpp')
-rw-r--r--themes/src/spring/spring_theme.hpp45
1 files changed, 45 insertions, 0 deletions
diff --git a/themes/src/spring/spring_theme.hpp b/themes/src/spring/spring_theme.hpp
new file mode 100644
index 0000000..6079958
--- /dev/null
+++ b/themes/src/spring/spring_theme.hpp
@@ -0,0 +1,45 @@
+#ifndef SPRING_THEME_HPP
+#define SPRING_THEME_HPP
+
+#include "../mathlib.h"
+#include "../types.h"
+#include "../renderer_3d.h"
+#include "../theme.h"
+
+
+enum class SpringThemeState {
+ Loading = 0,
+ LoadedShader,
+ LoadedBunny,
+ PreHop,
+ Hopping,
+ Idle
+};
+
+class SpringTheme : public Theme {
+public:
+ SpringTheme(WebglContext*);
+ ~SpringTheme();
+ Renderer3d renderer;
+ SpringThemeState state;
+ f32 bunnySpeed = 5.f;
+ Vector3 bunnyPosition = Vector3(0, 0, 0);
+ Vector3 bunnyTarget = Vector3(0, 0, 0);
+ Vector3 hopIncrement = Vector3(0, 0, 0);
+
+ f32 numHops = 0;
+ f32 hopCount = 0;
+ f32 bunnyHopAnimationTimer = 0.f;
+ f32 stateTimer = 0.f;
+ f32 bunnyRotation = 0.f;
+ f32 targetRotation = 0.f;
+
+ Mesh3d bunnyMesh;
+
+ void load(WebglContext*);
+ void update(f32 dtSeconds);
+ void render();
+ void unload();
+};
+
+#endif