From 9625b751757b8828b0edb0b7543c7cadfd25c119 Mon Sep 17 00:00:00 2001 From: WBoerenkamps Date: Wed, 8 Jan 2025 12:38:24 +0100 Subject: enemy sequence working --- game/player/PlayerScript.cpp | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'game/player/PlayerScript.cpp') diff --git a/game/player/PlayerScript.cpp b/game/player/PlayerScript.cpp index dc3eec3..7bc5e55 100644 --- a/game/player/PlayerScript.cpp +++ b/game/player/PlayerScript.cpp @@ -1,4 +1,3 @@ -#include #include "PlayerScript.h" #include "../Config.h" @@ -157,25 +156,19 @@ void PlayerScript::fixed_update(crepe::duration_t dt) { } void PlayerScript::shoot(const vec2& location,float angle){ - //cout << "player shot" << endl; RefVector bullet_transforms = this->get_components_by_tag("player_bullet"); for(Transform& bullet_pos : bullet_transforms){ - //cout << "bullet pos x: " << bullet_pos.position.x << " y: " << bullet_pos.position.y << endl; if(bullet_pos.position.x == 0 && bullet_pos.position.y == -850){ - - //cout << "bullet found\n"; + bullet_pos.position = location; bullet_pos.position.x += 20; - //cout << "bullet pos x: " << bullet_pos.position.x << " y: " << bullet_pos.position.y << endl; Rigidbody& bullet_body = this->get_components_by_id(bullet_pos.game_object_id).front(); BoxCollider bullet_collider = this->get_components_by_id(bullet_pos.game_object_id).front(); - //bullet_collider.active = true; bullet_body.active = true; BehaviorScript& bullet_script = this->get_components_by_id(bullet_pos.game_object_id).front(); bullet_script.active = true; return; } } - cout << "bullet not found\n"; } -- cgit v1.2.3