diff options
author | JAROWMR <jarorutjes07@gmail.com> | 2025-01-03 16:12:14 +0100 |
---|---|---|
committer | JAROWMR <jarorutjes07@gmail.com> | 2025-01-03 16:12:14 +0100 |
commit | f18635b6c73f753bd38343684134430a5ce9b22c (patch) | |
tree | e838c01914244c517b17d6359241a8cbf78ac6ae /game/coins/CoinSubScene.cpp | |
parent | b82c302e2eb5044ae966230a50aae9bdb698cf8c (diff) |
added coins random and menu banner update
Diffstat (limited to 'game/coins/CoinSubScene.cpp')
-rw-r--r-- | game/coins/CoinSubScene.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/game/coins/CoinSubScene.cpp b/game/coins/CoinSubScene.cpp index 0a1cd68..d30f5a4 100644 --- a/game/coins/CoinSubScene.cpp +++ b/game/coins/CoinSubScene.cpp @@ -1,11 +1,13 @@ #include "CoinSubScene.h" #include "api/Animator.h" +#include "api/BehaviorScript.h" #include "api/CircleCollider.h" #include "api/Rigidbody.h" #include "api/Scene.h" #include "api/AudioSource.h" #include <concepts> #include <iostream> +#include "CoinScript.h" using namespace crepe; using namespace std; @@ -19,7 +21,8 @@ int CoinSubScene::create(Scene & scn){ GameObject coin = scn.new_object(unique_name.c_str(),"coin",vec2{650,0},0,1); coin.add_component<Rigidbody>(Rigidbody::Data{ - .body_type = Rigidbody::BodyType::KINEMATIC + .body_type = Rigidbody::BodyType::KINEMATIC, + .kinematic_collision = false, }); coin.add_component<CircleCollider>(size.x / 2).active = false; crepe::OptionalRef<crepe::Sprite> coin_sprite = coin.add_component<Sprite>(Asset{"asset/coin/coin1_TVOS.png"}, Sprite::Data{ @@ -34,5 +37,6 @@ int CoinSubScene::create(Scene & scn){ .looping = true, }); coin.add_component<AudioSource>(Asset{"asset/sfx/coin_pickup_1.ogg"}); + coin.add_component<BehaviorScript>().set_script<CoinScript>(); return coin_counter; } |