From fd5392e2a4617db5669178169c289dd966064393 Mon Sep 17 00:00:00 2001 From: max-001 Date: Tue, 17 Dec 2024 12:29:04 +0100 Subject: Improved script --- src/example/GameScene.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/example/GameScene.cpp b/src/example/GameScene.cpp index 2c1f989..107f964 100644 --- a/src/example/GameScene.cpp +++ b/src/example/GameScene.cpp @@ -65,13 +65,16 @@ public: jetpack_sprite.active = true; } - // Start camera movement and enable player jumping + // Start camera movement, enable player jumping and disable this script if (player_transform.position.x == 150) { Rigidbody & rb = this->get_components_by_name("camera").front(); rb.data.linear_velocity = vec2(100, 0); BehaviorScript & player_script = this->get_components_by_name("player").front(); player_script.active = true; + BehaviorScript & this_script + = this->get_components_by_name("start_game_script").front(); + this_script.active = false; } } }; -- cgit v1.2.3