diff options
author | max-001 <maxsmits21@kpnmail.nl> | 2024-12-09 13:24:27 +0100 |
---|---|---|
committer | max-001 <maxsmits21@kpnmail.nl> | 2024-12-09 13:24:27 +0100 |
commit | ee56ebd4cf1ca1ef04f1f8c36431ebb54447cc46 (patch) | |
tree | c15bbd0f6524064569690b4436b5d91f3feeafd4 /src/example/AITest.cpp | |
parent | a4d76993e51ac4486fc313e868285eb7b4cb89f2 (diff) | |
parent | 4d74c80d9c3c9fdca9b07d960a1f9fd3e38cdfad (diff) |
Merge remote-tracking branch 'origin/master' into max/AI
Diffstat (limited to 'src/example/AITest.cpp')
-rw-r--r-- | src/example/AITest.cpp | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/src/example/AITest.cpp b/src/example/AITest.cpp index 0920fb2..28537ed 100644 --- a/src/example/AITest.cpp +++ b/src/example/AITest.cpp @@ -48,8 +48,13 @@ public: GameObject game_object2 = mgr.new_object("", "", vec2{0, 0}, 0, 1); 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<Sprite>(img, Sprite::Data{ + .color = Color::MAGENTA, + .flip = Sprite::FlipSettings{false, false}, + .sorting_in_layer = 1, + .order_in_layer = 1, + .size = {0, 195}, + }); AI & ai = game_object1.add_component<AI>(3000); // ai.arrive_on(); // ai.flee_on(); @@ -57,13 +62,16 @@ public: ai.make_circle_path(1000, {0, -1000}, 1.5707, true); ai.make_circle_path(1000, {0, 1000}, 4.7124, false); game_object1.add_component<Rigidbody>(Rigidbody::Data{ - .mass = 0.5f, + .mass = 0.1f, .max_linear_velocity = {40, 40}, }); game_object1.add_component<BehaviorScript>().set_script<Script1>(); - game_object2.add_component<Camera>(Color::WHITE, ivec2{1080, 720}, vec2{5000, 5000}, - 1.0f); + game_object2.add_component<Camera>(ivec2{1080, 720}, vec2{5000, 5000}, + Camera::Data{ + .bg_color = Color::WHITE, + .zoom = 1, + }); } string get_name() const override { return "Scene1"; } |