diff options
author | heavydemon21 <nielsstunnebrink1@gmail.com> | 2024-12-11 14:38:08 +0100 |
---|---|---|
committer | heavydemon21 <nielsstunnebrink1@gmail.com> | 2024-12-11 14:38:08 +0100 |
commit | 68c6e53f195677a3f91deb1526275fd38e00341d (patch) | |
tree | 2c310c8fa699dc88d2e609f3bd38bc9681aaca83 /src/example/sound.cpp | |
parent | 2bcd6ece912ab0a140f9d925718e8787879d1ed7 (diff) |
make format
Diffstat (limited to 'src/example/sound.cpp')
-rw-r--r-- | src/example/sound.cpp | 54 |
1 files changed, 0 insertions, 54 deletions
diff --git a/src/example/sound.cpp b/src/example/sound.cpp deleted file mode 100644 index a9b0930..0000000 --- a/src/example/sound.cpp +++ /dev/null @@ -1,54 +0,0 @@ - - -#include "api/Asset.h" -#include "api/AudioSource.h" -#include "api/BehaviorScript.h" -#include "api/Camera.h" -#include "api/GameObject.h" -#include "api/LoopManager.h" -#include "api/Scene.h" -#include "api/Script.h" -#include "manager/ComponentManager.h" -#include "types.h" -#include <string> - -using namespace crepe; - - -class ScriptTest : public Script { - void init(){ - auto & audio = this->get_component<AudioSource>(); - audio.play(); - } - void update(){ - } -}; - - -class TestSound : public Scene { -public: - void load_scene(){ - Mediator & mediator = this->mediator; - ComponentManager & mgr = mediator.component_manager; - - GameObject obj = mgr.new_object("SOUND"); - GameObject cam = mgr.new_object("cam"); - cam.add_component<Camera>(ivec2{100,100},vec2{100,100}, Camera::Data{}); - - Asset asset{"asset/audio/sample.ogg"}; - auto & test = obj.add_component<AudioSource>(asset); - obj.add_component<BehaviorScript>().set_script<ScriptTest>(); - - - } - - std::string get_name() const { return "TestScene"; }; - -}; - -int main(){ - LoopManager engine; - engine.add_scene<TestSound>(); - engine.start(); - return 0; -} |