aboutsummaryrefslogtreecommitdiff
path: root/game/StartGameScript.cpp
diff options
context:
space:
mode:
authorWBoerenkamps <wrj.boerenkamps@student.avans.nl>2025-01-08 12:50:47 +0100
committerWBoerenkamps <wrj.boerenkamps@student.avans.nl>2025-01-08 12:50:47 +0100
commit1e25ce23534c1dcc7bebfc9fe33c1b587f15643a (patch)
tree6fead7e7fa81f7ac747fa074eefcda99dea5cac9 /game/StartGameScript.cpp
parent5dc1a71ee3be5f72cdce0a2fdef21f4b46955557 (diff)
removed unwanted / removed lines
Diffstat (limited to 'game/StartGameScript.cpp')
-rw-r--r--game/StartGameScript.cpp21
1 files changed, 10 insertions, 11 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;
+ }
}