aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/ParticleEmitter.hpp
blob: 682a2ae29f30fc1393104cd60ee69fb67a402b77 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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);
};