diff options
author | jaroWMR <jarorutjes07@gmail.com> | 2024-10-01 19:10:24 +0200 |
---|---|---|
committer | jaroWMR <jarorutjes07@gmail.com> | 2024-10-01 19:10:24 +0200 |
commit | bd24f87e18bef29679023ee9a60028f2afdbb470 (patch) | |
tree | aa17d05db8ba6d5f959e676aa2c51c67743108b3 /src/crepe/ParticleEmitter.hpp | |
parent | a78f7bbfcdabad9550afe22f615b973b92cb074f (diff) |
particle POC
Diffstat (limited to 'src/crepe/ParticleEmitter.hpp')
-rw-r--r-- | src/crepe/ParticleEmitter.hpp | 28 |
1 files changed, 28 insertions, 0 deletions
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 <vector> +#include <cstdlib> +#include <ctime> +#include "Particle.hpp" +#include <cmath> + +class ParticleEmitter { +public: + std::vector<Particle> 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); +}; |