From 6c8b565b2f312c25ed0c64cab1a75729d705f19d Mon Sep 17 00:00:00 2001 From: JAROWMR Date: Sun, 10 Nov 2024 19:22:42 +0100 Subject: make empty example particle --- src/example/particles.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'src/example') diff --git a/src/example/particles.cpp b/src/example/particles.cpp index 01e33cf..407df4e 100644 --- a/src/example/particles.cpp +++ b/src/example/particles.cpp @@ -1,8 +1,5 @@ #include -#include -#include #include -#include #include #include @@ -18,11 +15,14 @@ using namespace crepe; using namespace std; int main(int argc, char * argv[]) { - - GameObject *game_object = new GameObject(0, "Name", "Tag", Vector2{0,0},0,0); - game_object->add_component(ParticleEmitter::ParticleEmitterData{ + GameObject game_object(0, "", "", Vector2{0, 0}, 0, 0); + Color color(0, 0, 0, 0); + Sprite test_sprite = game_object.add_component( + make_shared("../asset/texture/img.png"), color, + FlipSettings{true, true}); + game_object.add_component(ParticleEmitter::Data{ .position = {0,0}, - .max_particles = 0, + .max_particles = 100, .emission_rate = 0, .min_speed = 0, .max_speed = 0, @@ -32,12 +32,12 @@ int main(int argc, char * argv[]) { .end_lifespan = 0, .force_over_time = Vector2{0,0}, .boundary{ - .boundary_width = 0, - .boundary_height = 0, - .boundary_offset = Vector2{0,0}, + .width = 0, + .height = 0, + .offset = Vector2{0,0}, .reset_on_exit = false, }, - .sprite = nullptr, + .sprite = test_sprite, }); return 0; -- cgit v1.2.3