From bd24f87e18bef29679023ee9a60028f2afdbb470 Mon Sep 17 00:00:00 2001 From: jaroWMR Date: Tue, 1 Oct 2024 19:10:24 +0200 Subject: particle POC --- src/crepe/ParticleEmitter.hpp | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 src/crepe/ParticleEmitter.hpp (limited to 'src/crepe/ParticleEmitter.hpp') diff --git a/src/crepe/ParticleEmitter.hpp b/src/crepe/ParticleEmitter.hpp new file mode 100644 index 0000000..682a2ae --- /dev/null +++ b/src/crepe/ParticleEmitter.hpp @@ -0,0 +1,28 @@ +#pragma once + +#include +#include +#include +#include "Particle.hpp" +#include + +class ParticleEmitter { +public: + std::vector particles; + + struct Position { + int x; + int y; + } position; + + int maxParticles; + float emissionRate; + float elapsedTime; + + ParticleEmitter(int maxParticles, float emissionRate); + void update(float deltaTime); + +private: + void emitParticle(); + float randFloat(float minangle, float maxangle, float minVel, float maxVel); +}; -- cgit v1.2.3