From 6d69c8ef6b663bd6716b441cc7d01164c7e33dfc Mon Sep 17 00:00:00 2001 From: Loek Le Blansch Date: Tue, 7 Jan 2025 13:04:49 +0100 Subject: more WIP zapperpool --- game/prefab/ZapperObject.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'game/prefab/ZapperObject.cpp') 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(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; +} + -- cgit v1.2.3