From fe396c458b38ee209dd4c1f3ba4d053bef20f57a Mon Sep 17 00:00:00 2001 From: JAROWMR Date: Thu, 19 Dec 2024 12:55:04 +0100 Subject: tested system, added roation to emitter --- src/example/game.cpp | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'src/example/game.cpp') diff --git a/src/example/game.cpp b/src/example/game.cpp index ce2f351..2660055 100644 --- a/src/example/game.cpp +++ b/src/example/game.cpp @@ -220,11 +220,11 @@ public: }); GameObject game_object1 = new_object( - "Name", "Tag", vec2{screen_size_width / 2, screen_size_height / 2+60}, 0, 1); + "Name", "Tag", vec2{screen_size_width / 2, screen_size_height / 2+20}, 0, 1); game_object1.add_component(Rigidbody::Data{ .mass = 1, .gravity_scale = 0, - .body_type = Rigidbody::BodyType::KINEMATIC, + .body_type = Rigidbody::BodyType::STATIC, .linear_velocity = {0, 0}, .constraints = {0, 0, 0}, .elastisity_coefficient = 1, @@ -253,11 +253,11 @@ public: = false; GameObject game_object2 = new_object( - "Name", "Tag", vec2{screen_size_width / 2, screen_size_height / 2}, 0, 1); + "Name", "Tag", vec2{screen_size_width / 2, screen_size_height / 2}, 90, 1); game_object2.add_component(Rigidbody::Data{ .mass = 1, .gravity_scale = 0, - .body_type = Rigidbody::BodyType::DYNAMIC, + .body_type = Rigidbody::BodyType::STATIC, .linear_velocity = {0, 0}, .constraints = {0, 0, 0}, .elastisity_coefficient = 1, @@ -268,6 +268,9 @@ public: game_object2.add_component(img1, Sprite::Data{ .size = {20, 20}, + .angle_offset = 45, + .scale_offset = 1, + .position_offset = {0,20}, }); //add circle with cirlcecollider deactiveated @@ -280,12 +283,14 @@ public: }) .active = false; - Asset img5{"asset/texture/square.png"}; + Asset img5{"asset/texture/test_ap43.png"}; GameObject particle = new_object( - "Name", "Tag", vec2{screen_size_width / 2, screen_size_height / 2}, 0, 1); + "Name", "Tag", vec2{screen_size_width / 2, screen_size_height / 2}, 90, 1); auto & particle_image = particle.add_component(img5, Sprite::Data{ - .size = {5, 5}, + .size = {20, 20}, + .angle_offset = 45, + .scale_offset = 2, }); auto & test = particle.add_component(particle_image, ParticleEmitter::Data{ -- cgit v1.2.3