aboutsummaryrefslogtreecommitdiff
path: root/src/example
diff options
context:
space:
mode:
authorJAROWMR <jarorutjes07@gmail.com>2024-11-22 15:20:27 +0100
committerJAROWMR <jarorutjes07@gmail.com>2024-11-22 15:20:27 +0100
commit503c1d15d35fc06ac36febc72a8aa8abe38707ce (patch)
treeaa37ac9fe0b8a19e050e3377fbf385a361973339 /src/example
parent2c2855b77a8a1a6e21a26fea5c5735dfbbc6066d (diff)
parent4117d1d287f1d87efd0577d56819520e981a7f1c (diff)
merge with master
Diffstat (limited to 'src/example')
-rw-r--r--src/example/rendering_particle.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/example/rendering_particle.cpp b/src/example/rendering_particle.cpp
index 4571afb..b38e860 100644
--- a/src/example/rendering_particle.cpp
+++ b/src/example/rendering_particle.cpp
@@ -1,5 +1,6 @@
#include "api/Camera.h"
#include "system/ParticleSystem.h"
+#include "types.h"
#include <SDL2/SDL_timer.h>
#include <crepe/ComponentManager.h>
@@ -23,14 +24,14 @@ using namespace std;
int main(int argc, char * argv[]) {
ComponentManager mgr;
- GameObject game_object = mgr.new_object("", "", Vector2{100, 100}, 0, 0.1);
+ GameObject game_object = mgr.new_object("", "", vec2{0, 0}, 0, 0.1);
RenderSystem sys{mgr};
ParticleSystem psys{mgr};
Color color(255, 255, 255, 255);
Sprite & test_sprite = game_object.add_component<Sprite>(
- make_shared<Texture>("../asset/texture/img.png"), color, FlipSettings{false, false});
+ make_shared<Texture>("asset/texture/img.png"), color, FlipSettings{false, false});
test_sprite.order_in_layer = 5;
auto & test = game_object.add_component<ParticleEmitter>(ParticleEmitter::Data{
@@ -43,11 +44,11 @@ int main(int argc, char * argv[]) {
.max_angle = 20,
.begin_lifespan = 0,
.end_lifespan = 60,
- .force_over_time = Vector2{0, 0},
+ .force_over_time = vec2{0, 0},
.boundary{
.width = 1000,
.height = 1000,
- .offset = Vector2{0, 0},
+ .offset = vec2{0, 0},
.reset_on_exit = false,
},
.sprite = test_sprite,
@@ -55,7 +56,7 @@ int main(int argc, char * argv[]) {
game_object.add_component<Camera>(Color::WHITE);
game_object
- .add_component<Sprite>(make_shared<Texture>("../asset/texture/img.png"), color,
+ .add_component<Sprite>(make_shared<Texture>("asset/texture/img.png"), color,
FlipSettings{false, false})
.order_in_layer
= 6;