aboutsummaryrefslogtreecommitdiff
path: root/game/prefab/ZapperObject.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'game/prefab/ZapperObject.cpp')
-rw-r--r--game/prefab/ZapperObject.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/game/prefab/ZapperObject.cpp b/game/prefab/ZapperObject.cpp
index 4055ac4..3c70d04 100644
--- a/game/prefab/ZapperObject.cpp
+++ b/game/prefab/ZapperObject.cpp
@@ -81,6 +81,7 @@ ZapperObject::ZapperObject(crepe::GameObject && base)
})},
collider {add_component<BoxCollider>(vec2(0, 0))} {
this->place(this->transform.position, 0, 300);
+ this->set_active(false);
}
void ZapperObject::place(const crepe::vec2 & position, float rotation, float length) {
@@ -98,3 +99,20 @@ void ZapperObject::place(const crepe::vec2 & position, float rotation, float len
this->collider.dimensions = offset.rotate(rotation) * 2 + vec2(30, 30) * SCALE;
}
+
+void ZapperObject::set_active(bool active) {
+ this->sprite.orb_start.active = active;
+ this->sprite.orb_end.active = active;
+ this->sprite.glow_start.active = active;
+ this->sprite.glow_end.active = active;
+ this->sprite.beam.active = active;
+
+ this->animator.orb_start.active = active;
+ this->animator.orb_end.active = active;
+ this->animator.glow_start.active = active;
+ this->animator.glow_end.active = active;
+
+ this->body.active = active;
+ this->collider.active = active;
+}
+