diff options
Diffstat (limited to 'src/example/script.cpp')
-rw-r--r-- | src/example/script.cpp | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/example/script.cpp b/src/example/script.cpp index cda9591..dac7af3 100644 --- a/src/example/script.cpp +++ b/src/example/script.cpp @@ -4,7 +4,7 @@ */ #include <crepe/ComponentManager.h> -#include <crepe/ScriptSystem.h> +#include <crepe/system/ScriptSystem.h> #include <crepe/util/log.h> #include <crepe/api/BehaviorScript.h> @@ -14,20 +14,17 @@ #include <crepe/api/Transform.h> using namespace crepe; -using namespace crepe::api; using namespace std; // Unrelated stuff that is not part of this POC -int _ = [] () { +int _ = []() { // Show dbg_trace() output - auto & cfg = api::Config::get_instance(); - cfg.log.level = util::LogLevel::TRACE; + auto & cfg = Config::get_instance(); + cfg.log.level = LogLevel::TRACE; return 0; // satisfy compiler }(); - - // User-defined script: class MyScript : public Script { void update() { @@ -40,7 +37,12 @@ class MyScript : public Script { int main() { // Create game object with Transform and BehaviorScript components auto obj = GameObject(0, "name", "tag", 0); - obj.add_component<Transform>(Point { .x = 1.2, .y = 3.4, }, 0, 0); + obj.add_component<Transform>( + Point{ + .x = 1.2, + .y = 3.4, + }, + 0, 0); obj.add_component<BehaviorScript>().set_script<MyScript>(); // Get ScriptSystem singleton instance (this would normally be done from the @@ -51,4 +53,3 @@ int main() { return EXIT_SUCCESS; } - |