aboutsummaryrefslogtreecommitdiff
path: root/src/example/audio-crash.cpp
diff options
context:
space:
mode:
authorLoek Le Blansch <loek@pipeframe.xyz>2024-12-18 13:04:27 +0100
committerLoek Le Blansch <loek@pipeframe.xyz>2024-12-18 13:04:27 +0100
commitcd389129cc2ed73596251cb7c9cc606f6e6d74d8 (patch)
treead79b4872bf34524dd9ef166477254565c7a7c80 /src/example/audio-crash.cpp
parent38c5e1bb819d2bf06b9d8c387726fa285a9a3065 (diff)
restore examples
Diffstat (limited to 'src/example/audio-crash.cpp')
-rw-r--r--src/example/audio-crash.cpp47
1 files changed, 0 insertions, 47 deletions
diff --git a/src/example/audio-crash.cpp b/src/example/audio-crash.cpp
deleted file mode 100644
index 6c1052e..0000000
--- a/src/example/audio-crash.cpp
+++ /dev/null
@@ -1,47 +0,0 @@
-#include <crepe/api/LoopManager.h>
-#include <crepe/api/Scene.h>
-#include <crepe/api/Camera.h>
-#include <crepe/api/AudioSource.h>
-#include <crepe/api/Config.h>
-
-#define private public
-#include <crepe/api/Script.h>
-
-using namespace crepe;
-using namespace std;
-
-class Auto : public Script {
- unsigned i = 0;
- void init() {
- AudioSource & sound = get_component<AudioSource>();
- sound.play();
- }
-
- void update() {
- if (++i < 50) return;
- EventManager & evmgr = this->mediator->event_manager;
- evmgr.trigger_event<ShutDownEvent>();
- }
-};
-
-class Bug : public Scene {
- virtual std::string get_name() const override { return "bug"; }
- void load_scene() override {
- GameObject camera = new_object("camera");
- camera.add_component<Camera>(ivec2{10, 10}, vec2{1, 1}, Camera::Data{ });
-
- GameObject sound = new_object("sound");
- sound.add_component<AudioSource>(Asset{"mwe/audio/bgm.ogg"});
- sound.add_component<BehaviorScript>().set_script<Auto>();
- }
-};
-
-int main() {
- Config & config = Config::get_instance();
- config.log.level = Log::Level::TRACE;
-
- LoopManager example;
- example.add_scene<Bug>();
- example.start();
- return 0;
-}