diff options
author | heavydemon21 <nielsstunnebrink1@gmail.com> | 2025-01-08 15:57:05 +0100 |
---|---|---|
committer | heavydemon21 <nielsstunnebrink1@gmail.com> | 2025-01-08 15:57:05 +0100 |
commit | 1ec7e724fcace1274473dfcae91022cc1c930baa (patch) | |
tree | 1508e8cd74588f388093dae81432fa66ecd436f2 /game/enemy | |
parent | ce83df284173cfb4f6e430bf3ed8080ea21204d7 (diff) |
working scheduler and enemies and rest
Diffstat (limited to 'game/enemy')
-rw-r--r-- | game/enemy/BattleScript.cpp | 2 | ||||
-rw-r--r-- | game/enemy/EnemyScript.cpp | 3 |
2 files changed, 2 insertions, 3 deletions
diff --git a/game/enemy/BattleScript.cpp b/game/enemy/BattleScript.cpp index dde8da1..4260c42 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, diff --git a/game/enemy/EnemyScript.cpp b/game/enemy/EnemyScript.cpp index 8e475a8..07ed9e8 100644 --- a/game/enemy/EnemyScript.cpp +++ b/game/enemy/EnemyScript.cpp @@ -84,8 +84,7 @@ bool EnemyScript::spawn_enemy(const SpawnEnemyEvent & e) { bool EnemyScript::on_collide(const CollisionEvent & e) { if (e.info.other.metadata.tag == "player_bullet") { - //this->despawn_enemy(); - + this->despawn_enemy(); } Animator& body_animator = this->get_components<Animator>().front(); body_animator.data.col = 2; |