diff options
author | WBoerenkamps <wrj.boerenkamps@student.avans.nl> | 2025-01-08 10:08:03 +0100 |
---|---|---|
committer | WBoerenkamps <wrj.boerenkamps@student.avans.nl> | 2025-01-08 10:08:03 +0100 |
commit | 7f7c5c56dce30d47c32fb57fad6d839d0990b054 (patch) | |
tree | eebc8d3f4c332d969f4a66a566edd844bd43387c /game/StartGameScript.cpp | |
parent | ceb41b7ae7e2734af954364b319fc0b6f2a86c2f (diff) |
enemy spawn working + enemy shooting
Diffstat (limited to 'game/StartGameScript.cpp')
-rw-r--r-- | game/StartGameScript.cpp | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/game/StartGameScript.cpp b/game/StartGameScript.cpp index c786eb4..5698a53 100644 --- a/game/StartGameScript.cpp +++ b/game/StartGameScript.cpp @@ -1,3 +1,4 @@ +#include <iostream> #include "StartGameScript.h" #include "Config.h" @@ -10,7 +11,7 @@ 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(); @@ -49,14 +50,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; + // } } |