aboutsummaryrefslogtreecommitdiff
path: root/game/workers
diff options
context:
space:
mode:
Diffstat (limited to 'game/workers')
-rw-r--r--game/workers/CollisionScript.cpp20
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;
}