aboutsummaryrefslogtreecommitdiff
path: root/game/prefab/ZapperScript.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'game/prefab/ZapperScript.cpp')
-rw-r--r--game/prefab/ZapperScript.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/game/prefab/ZapperScript.cpp b/game/prefab/ZapperScript.cpp
new file mode 100644
index 0000000..b9b24be
--- /dev/null
+++ b/game/prefab/ZapperScript.cpp
@@ -0,0 +1,23 @@
+#include <crepe/api/Rigidbody.h>
+#include <cassert>
+
+#include "ZapperScript.h"
+
+using namespace crepe;
+using namespace std;
+
+ZapperScript::ZapperScript(const ZapperObject & zapper) : zapper(zapper) { }
+
+void ZapperScript::init() {
+ zapper.sprite.beam.mask = {
+ .w = 350,
+ .h = 117,
+ .x = 0,
+ .y = 0,
+ };
+}
+
+void ZapperScript::frame_update(duration_t delta_time) {
+ zapper.sprite.beam.mask.x += 4;
+}
+