diff options
Diffstat (limited to 'game/scheduler/ObjectsScheduler.cpp')
| -rw-r--r-- | game/scheduler/ObjectsScheduler.cpp | 21 | 
1 files changed, 14 insertions, 7 deletions
diff --git a/game/scheduler/ObjectsScheduler.cpp b/game/scheduler/ObjectsScheduler.cpp index 02d84c1..60e3f47 100644 --- a/game/scheduler/ObjectsScheduler.cpp +++ b/game/scheduler/ObjectsScheduler.cpp @@ -2,8 +2,8 @@  #include "ObjectsScheduler.h" -#include "../Random.h"  #include "../Config.h" +#include "../Random.h"  #include "../missile/SpawnEvent.h"  #include "api/Rigidbody.h"  #include "api/Transform.h" @@ -11,20 +11,25 @@  #include "prefab/ZapperPoolSubScene.h"  using namespace crepe; -void ObjectsScheduler::preset_0() { trigger_event<MissileSpawnEvent>(MissileSpawnEvent {}); } +void ObjectsScheduler::preset_0() { +	trigger_event<MissileSpawnEvent>(MissileSpawnEvent {}); +	trigger_event<MissileSpawnEvent>(MissileSpawnEvent {}); +}  void ObjectsScheduler::preset_1() { trigger_event<MissileSpawnEvent>(MissileSpawnEvent {}); }  void ObjectsScheduler::preset_2() { trigger_event<CreateZapperEvent>(CreateZapperEvent {}); } -void ObjectsScheduler::preset_3() {} +void ObjectsScheduler::preset_3() { trigger_event<CreateZapperEvent>(CreateZapperEvent {}); }  void ObjectsScheduler::preset_4() {} -void ObjectsScheduler::boss_fight_1() {  +void ObjectsScheduler::boss_fight_1() {  	this->get_components_by_name<Rigidbody>("camera").front().get().data.linear_velocity.x = 0;  	this->get_components_by_name<Rigidbody>("player").front().get().data.linear_velocity.x = 0; -	this->trigger_event<BattleStartEvent>(BattleStartEvent{.num_enemies = 2}); +	this->trigger_event<BattleStartEvent>(BattleStartEvent {.num_enemies = 2});  }  bool ObjectsScheduler::boss_fight_1_event() { -	this->get_components_by_name<Rigidbody>("camera").front().get().data.linear_velocity.x = PLAYER_SPEED * 0.02; -	this->get_components_by_name<Rigidbody>("player").front().get().data.linear_velocity.x = PLAYER_SPEED * 0.02; +	this->get_components_by_name<Rigidbody>("camera").front().get().data.linear_velocity.x +		= PLAYER_SPEED * 0.02; +	this->get_components_by_name<Rigidbody>("player").front().get().data.linear_velocity.x +		= PLAYER_SPEED * 0.02;  	return false;  } @@ -32,6 +37,8 @@ void ObjectsScheduler::init() {  	this->obstacles.push_back([this]() { preset_0(); });  	this->obstacles.push_back([this]() { preset_1(); });  	this->obstacles.push_back([this]() { preset_2(); }); +	this->obstacles.push_back([this]() { preset_3(); }); +	this->obstacles.push_back([this]() { preset_4(); });  	this->obstacles.push_back([this]() { boss_fight_1(); });  |