diff options
author | max-001 <maxsmits21@kpnmail.nl> | 2024-12-06 10:39:18 +0100 |
---|---|---|
committer | max-001 <maxsmits21@kpnmail.nl> | 2024-12-06 10:39:18 +0100 |
commit | 9c2cafd85ed7aa9a860ba25fbe2bd3ccc2439f29 (patch) | |
tree | 1b0601f5867acbfe6adf2defe097f067495aedfa /src/example/AITest.cpp | |
parent | 42ecf9c1d0e3ed1f37f99a24f31241b68f978b28 (diff) |
Using Rigidbody from now on
Diffstat (limited to 'src/example/AITest.cpp')
-rw-r--r-- | src/example/AITest.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/example/AITest.cpp b/src/example/AITest.cpp index 91a529c..2b6a4d6 100644 --- a/src/example/AITest.cpp +++ b/src/example/AITest.cpp @@ -6,6 +6,7 @@ #include <crepe/api/Color.h> #include <crepe/api/GameObject.h> #include <crepe/api/LoopManager.h> +#include <crepe/api/Rigidbody.h> #include <crepe/api/Scene.h> #include <crepe/api/Script.h> #include <crepe/api/Sprite.h> @@ -40,7 +41,10 @@ public: Texture img = Texture("asset/texture/test_ap43.png"); game_object1.add_component<Sprite>(img, Color::MAGENTA, Sprite::FlipSettings{false, false}, 1, 1, 195); - game_object1.add_component<AI>(1, 200, 200).seek_on(); + game_object1.add_component<AI>(200).seek_on(); + game_object1.add_component<Rigidbody>(Rigidbody::Data{ + .mass = 1.0f, .max_linear_velocity = {21, 21}, // sqrt(21^2 + 21^2) = 30 + }); game_object2.add_component<Camera>(Color::WHITE, ivec2{1080, 720}, vec2{1036, 780}, 1.0f); |