diff options
author | Max-001 <maxsmits21@kpnmail.nl> | 2025-01-08 09:07:46 +0100 |
---|---|---|
committer | Max-001 <maxsmits21@kpnmail.nl> | 2025-01-08 09:07:46 +0100 |
commit | b8ff1dcd4e531c3c858ee09f705cf553e86ed7ff (patch) | |
tree | 1a79c10853fac119f31ae2e660210e841fc0fbf1 /game | |
parent | 231d33954dab62e2452eb88e509d2741a8437498 (diff) |
Adjusted script
Diffstat (limited to 'game')
-rw-r--r-- | game/workers/CollisionScript.cpp | 20 |
1 files changed, 1 insertions, 19 deletions
diff --git a/game/workers/CollisionScript.cpp b/game/workers/CollisionScript.cpp index 9e9b981..baa058b 100644 --- a/game/workers/CollisionScript.cpp +++ b/game/workers/CollisionScript.cpp @@ -1,9 +1,6 @@ #include "CollisionScript.h" #include <crepe/api/Animator.h> -#include <crepe/api/AudioSource.h> -#include <crepe/api/ParticleEmitter.h> - using namespace crepe; using namespace std; @@ -15,9 +12,7 @@ void CollisionScript::init() { } bool CollisionScript::on_collision(const CollisionEvent & ev) { - RefVector<Animator> animators = this->get_components_by_name<Animator>("player"); - RefVector<ParticleEmitter> emitters - = this->get_components_by_name<ParticleEmitter>("player"); + RefVector<Animator> animators = this->get_components<Animator>(); if (ev.info.other.metadata.tag == "zapper") { for (Animator & anim : animators) { @@ -25,9 +20,6 @@ bool CollisionScript::on_collision(const CollisionEvent & ev) { anim.set_anim(4); anim.data.looping = true; } - for (ParticleEmitter & emitter : emitters) { - emitter.data.emission_rate = 0; - } return true; } else if (ev.info.other.metadata.tag == "laser") { @@ -36,11 +28,6 @@ bool CollisionScript::on_collision(const CollisionEvent & ev) { anim.set_anim(4); anim.data.looping = true; } - for (ParticleEmitter & emitter : emitters) { - emitter.data.emission_rate = 0; - } - play_scr.active = false; - end_scr.active = true; return true; } else if (ev.info.other.metadata.tag == "missile") { @@ -49,11 +36,6 @@ bool CollisionScript::on_collision(const CollisionEvent & ev) { anim.set_anim(5); anim.data.looping = true; } - for (ParticleEmitter & emitter : emitters) { - emitter.data.emission_rate = 0; - } - play_scr.active = false; - end_scr.active = true; return true; } |