From 74f70c61a37c94727e1411696f050cf588cf3446 Mon Sep 17 00:00:00 2001 From: max-001 Date: Fri, 20 Dec 2024 12:05:52 +0100 Subject: Fix merge issues --- src/example/replay.cpp | 84 -------------------------------------------------- 1 file changed, 84 deletions(-) delete mode 100644 src/example/replay.cpp (limited to 'src/example/replay.cpp') diff --git a/src/example/replay.cpp b/src/example/replay.cpp deleted file mode 100644 index 82fd478..0000000 --- a/src/example/replay.cpp +++ /dev/null @@ -1,84 +0,0 @@ -#include -#include -#include - -using namespace crepe; -using namespace std; - -class AnimationScript : public Script { - Transform * transform; - float t = 0; - - void init() { transform = &get_component(); } - - void update() { - t += 0.05; - transform->position = {sin(t), cos(t)}; - } -}; - -class Timeline : public Script { - unsigned i = 0; - recording_t recording; - - void update() { - switch (i++) { - default: - break; - case 10: - logf("record start"); - replay.record_start(); - break; - case 60: - logf("record end, playing recording"); - this->recording = replay.record_end(); - replay.play(this->recording); - break; - case 61: - logf("done, releasing recording"); - replay.release(this->recording); - break; - case 72: - logf("exit"); - queue_event(); - break; - }; - } -}; - -class TestScene : public Scene { -public: - using Scene::Scene; - - void load_scene() { - Mediator & mediator = this->mediator; - ComponentManager & mgr = mediator.component_manager; - - GameObject cam = mgr.new_object("cam"); - cam.add_component(ivec2{640, 480}, vec2{3, 3}, - Camera::Data{ - .bg_color = Color::WHITE, - }); - - GameObject square = mgr.new_object("square"); - square.add_component(Asset{"asset/texture/square.png"}, Sprite::Data{ - .size = {0.5, 0.5}, - }); - square.add_component().set_script(); - - GameObject scapegoat = mgr.new_object(""); - scapegoat.add_component().set_script(); - } - - string get_name() const { return "scene1"; } -}; - -int main(int argc, char * argv[]) { - Config & cfg = Config::get_instance(); - cfg.log.level = Log::Level::DEBUG; - - Engine engine; - - engine.add_scene(); - return engine.main(); -} -- cgit v1.2.3