From 455bb50a5007daf46b8719fff2a6292da6a294bf Mon Sep 17 00:00:00 2001 From: Loek Le Blansch Date: Wed, 13 Nov 2024 11:39:45 +0100 Subject: fix physics test --- src/example/script.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/example') diff --git a/src/example/script.cpp b/src/example/script.cpp index 9e8b147..4ba2b4b 100644 --- a/src/example/script.cpp +++ b/src/example/script.cpp @@ -35,15 +35,15 @@ class MyScript : public Script { }; int main() { + ComponentManager component_manager {}; + ScriptSystem system { component_manager }; + // Create game object with Transform and BehaviorScript components - auto obj = GameObject(0, "name", "tag", Vector2{1.2, 3.4}, 0, 1); + auto & obj = component_manager.new_object("name"); obj.add_component().set_script(); - // Get ScriptSystem singleton instance (this would normally be done from the - // game loop) - ScriptSystem sys; // Update all scripts. This should result in MyScript::update being called - sys.update(); + system.update(); return EXIT_SUCCESS; } -- cgit v1.2.3