aboutsummaryrefslogtreecommitdiff
path: root/game/enemy
diff options
context:
space:
mode:
authorWBoerenkamps <wrj.boerenkamps@student.avans.nl>2025-01-08 15:46:56 +0100
committerWBoerenkamps <wrj.boerenkamps@student.avans.nl>2025-01-08 15:46:56 +0100
commitb6c7811eae4fa7c51f82c44c1558fcafc79c21e0 (patch)
treea04b2f095d1f40b992db76ac7a51860539bb309a /game/enemy
parent698628cf1fb1b8a1f68bf6a5672d984bd64be58f (diff)
queue added
Diffstat (limited to 'game/enemy')
-rw-r--r--game/enemy/BattleScript.cpp4
-rw-r--r--game/enemy/EnemyScript.cpp2
2 files changed, 3 insertions, 3 deletions
diff --git a/game/enemy/BattleScript.cpp b/game/enemy/BattleScript.cpp
index dde8da1..6d96ef6 100644
--- a/game/enemy/BattleScript.cpp
+++ b/game/enemy/BattleScript.cpp
@@ -39,7 +39,7 @@ bool BattleScript::create_battle(const BattleStartEvent & e) {
for (int i = 0; i < e.num_enemies; i++) {
BehaviorScript & script = enemy_scripts[i];
script.active = true;
- this->trigger_event<SpawnEnemyEvent>(
+ this->queue_event<SpawnEnemyEvent>(
SpawnEnemyEvent {
.speed = dist(engine),
.column = i,
@@ -47,5 +47,5 @@ bool BattleScript::create_battle(const BattleStartEvent & e) {
script.game_object_id
);
}
- return true;
+ return false;
}
diff --git a/game/enemy/EnemyScript.cpp b/game/enemy/EnemyScript.cpp
index 8e475a8..06626dd 100644
--- a/game/enemy/EnemyScript.cpp
+++ b/game/enemy/EnemyScript.cpp
@@ -79,7 +79,7 @@ bool EnemyScript::spawn_enemy(const SpawnEnemyEvent & e) {
ai_component.make_oval_path(10, 10, vec2 {x_value, random_height}, 1.5708, true);
ai_component.active = true;
this->last_fired = std::chrono::steady_clock::now();
- return true;
+ return false;
}
bool EnemyScript::on_collide(const CollisionEvent & e) {