diff options
author | Loek Le Blansch <loek@pipeframe.xyz> | 2024-11-03 13:34:27 +0100 |
---|---|---|
committer | Loek Le Blansch <loek@pipeframe.xyz> | 2024-11-03 13:34:27 +0100 |
commit | 2585dc3cab48ccad0cfa0c63354662d656c86c46 (patch) | |
tree | 579851837f35842e5ed682c912c470d68df79183 /src/example/script.cpp | |
parent | 5deb950619dff9dde8b49520b23e3ce4001afbee (diff) |
`make format`
Diffstat (limited to 'src/example/script.cpp')
-rw-r--r-- | src/example/script.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/example/script.cpp b/src/example/script.cpp index cda9591..5df26e8 100644 --- a/src/example/script.cpp +++ b/src/example/script.cpp @@ -18,7 +18,7 @@ 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; @@ -26,8 +26,6 @@ int _ = [] () { return 0; // satisfy compiler }(); - - // User-defined script: class MyScript : public Script { void update() { @@ -40,7 +38,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 +54,3 @@ int main() { return EXIT_SUCCESS; } - |