aboutsummaryrefslogtreecommitdiff
path: root/src/example/rendering_particle.cpp
diff options
context:
space:
mode:
authorheavydemon21 <nielsstunnebrink1@gmail.com>2024-11-20 14:06:54 +0100
committerheavydemon21 <nielsstunnebrink1@gmail.com>2024-11-20 14:06:54 +0100
commit3344e0df01435be903e38ccbd3b9cee608d574e7 (patch)
tree949a3a2d28ce143621f9da90aaea5361d95f9074 /src/example/rendering_particle.cpp
parent158022890cb9abd308a6a445588cc2fca8d84e67 (diff)
implemented feedback
Diffstat (limited to 'src/example/rendering_particle.cpp')
-rw-r--r--src/example/rendering_particle.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/example/rendering_particle.cpp b/src/example/rendering_particle.cpp
index 71b50ba..3f71750 100644
--- a/src/example/rendering_particle.cpp
+++ b/src/example/rendering_particle.cpp
@@ -4,15 +4,15 @@
#include <crepe/ComponentManager.h>
#include <crepe/Component.h>
+#include <crepe/api/Color.h>
#include <crepe/api/GameObject.h>
#include <crepe/api/ParticleEmitter.h>
#include <crepe/api/Rigidbody.h>
+#include <crepe/api/Sprite.h>
#include <crepe/api/Texture.h>
#include <crepe/api/Transform.h>
-#include <crepe/system/RenderSystem.h>
-#include <crepe/api/Color.h>
-#include <crepe/api/Sprite.h>
#include <crepe/api/Vector2.h>
+#include <crepe/system/RenderSystem.h>
#include <chrono>
@@ -20,15 +20,14 @@ using namespace crepe;
using namespace std;
int main(int argc, char * argv[]) {
- ComponentManager mgr;
+ ComponentManager mgr;
GameObject game_object = mgr.new_object("", "", Vector2{100, 100}, 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});
game_object.add_component<ParticleEmitter>(ParticleEmitter::Data{
.position = {0, 0},
.max_particles = 10,
@@ -54,9 +53,8 @@ int main(int argc, char * argv[]) {
while (std::chrono::steady_clock::now() - start < std::chrono::seconds(5)) {
psys.update();
sys.update();
- SDL_Delay(10 );
+ SDL_Delay(10);
}
return 0;
}
-