diff options
Diffstat (limited to 'game')
| -rw-r--r-- | game/StartGameScript.cpp | 21 | ||||
| -rw-r--r-- | game/enemy/BattleScript.cpp | 1 | ||||
| -rw-r--r-- | game/enemy/BattleScript.h | 4 | ||||
| -rw-r--r-- | game/enemy/BattleWonEvent.h | 5 | 
4 files changed, 14 insertions, 17 deletions
diff --git a/game/StartGameScript.cpp b/game/StartGameScript.cpp index 3de577c..8fbc17d 100644 --- a/game/StartGameScript.cpp +++ b/game/StartGameScript.cpp @@ -13,7 +13,6 @@ using namespace std;  void StartGameScript::fixed_update(crepe::duration_t dt) {  	Transform & player_transform = this->get_components_by_name<Transform>("player").front(); -	// cout << "startgameScript call speed: " << PLAYER_SPEED * dt.count() << endl;  	// Create hole in wall and activate panic lamp  	if (player_transform.position.x > 75 && !this->created_hole) {  		Sprite & lamp_sprite = this->get_components_by_name<Sprite>("start_end").back(); @@ -64,14 +63,14 @@ void StartGameScript::fixed_update(crepe::duration_t dt) {  	}  	// Start camera movement, enable player jumping and disable this script -	// if (player_transform.position.x > 500) { -	// 	Rigidbody & rb = this->get_components_by_name<Rigidbody>("camera").front(); -	// 	rb.data.linear_velocity = vec2(PLAYER_SPEED * dt.count(), 0); -	// 	BehaviorScript & player_script -	// 		= this->get_components_by_name<BehaviorScript>("player").front(); -	// 	player_script.active = true; -	// 	BehaviorScript & this_script -	// 		= this->get_components_by_name<BehaviorScript>("start_game_script").front(); -	// 	this_script.active = false; -	// } +	if (player_transform.position.x > 500) { +		Rigidbody & rb = this->get_components_by_name<Rigidbody>("camera").front(); +		rb.data.linear_velocity = vec2(PLAYER_SPEED * dt.count(), 0); +		BehaviorScript & player_script +			= this->get_components_by_name<BehaviorScript>("player").front(); +		player_script.active = true; +		BehaviorScript & this_script +			= this->get_components_by_name<BehaviorScript>("start_game_script").front(); +		this_script.active = false; +	}  } diff --git a/game/enemy/BattleScript.cpp b/game/enemy/BattleScript.cpp index 1d263a3..2564e3d 100644 --- a/game/enemy/BattleScript.cpp +++ b/game/enemy/BattleScript.cpp @@ -3,7 +3,6 @@  #include "EnemyScript.h"  #include <crepe/api/BehaviorScript.h>  #include <crepe/api/Metadata.h> -#include "BattleWonEvent.h"  #include "EnemyScript.h"  using namespace std;  using namespace crepe; diff --git a/game/enemy/BattleScript.h b/game/enemy/BattleScript.h index 55ca166..f91c597 100644 --- a/game/enemy/BattleScript.h +++ b/game/enemy/BattleScript.h @@ -4,6 +4,10 @@  #include <crepe/api/BehaviorScript.h>  #include <crepe/api/Event.h>  #include <random> +struct BattleWonEvent : public crepe::Event{ + +}; +  struct BattleStartEvent : public crepe::Event{  	public:   	int num_enemies = 0; diff --git a/game/enemy/BattleWonEvent.h b/game/enemy/BattleWonEvent.h deleted file mode 100644 index a48dbad..0000000 --- a/game/enemy/BattleWonEvent.h +++ /dev/null @@ -1,5 +0,0 @@ -#pragma once -#include <crepe/api/Event.h> -struct BattleWonEvent : public crepe::Event{ - -};  |