aboutsummaryrefslogtreecommitdiff
path: root/src/example
diff options
context:
space:
mode:
authorJAROWMR <jarorutjes07@gmail.com>2024-11-10 19:22:42 +0100
committerJAROWMR <jarorutjes07@gmail.com>2024-11-10 19:22:42 +0100
commit6c8b565b2f312c25ed0c64cab1a75729d705f19d (patch)
treeda1e9c18965802cf814c98363d929709ee4ced68 /src/example
parentbb0dba6b2a84a8bcbb1e07a14f015f73408d460c (diff)
make empty example particle
Diffstat (limited to 'src/example')
-rw-r--r--src/example/particles.cpp22
1 files changed, 11 insertions, 11 deletions
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 <crepe/ComponentManager.h>
-#include <crepe/system/RenderSystem.h>
-#include <crepe/system/CollisionSystem.h>
#include <crepe/api/AssetManager.h>
-#include <crepe/system/PhysicsSystem.h>
#include <crepe/Component.h>
#include <crepe/api/GameObject.h>
@@ -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>(ParticleEmitter::ParticleEmitterData{
+ GameObject game_object(0, "", "", Vector2{0, 0}, 0, 0);
+ Color color(0, 0, 0, 0);
+ Sprite test_sprite = game_object.add_component<Sprite>(
+ make_shared<Texture>("../asset/texture/img.png"), color,
+ FlipSettings{true, true});
+ game_object.add_component<ParticleEmitter>(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;