diff options
author | jaroWMR <jarorutjes07@gmail.com> | 2024-10-07 16:02:09 +0200 |
---|---|---|
committer | jaroWMR <jarorutjes07@gmail.com> | 2024-10-07 16:02:09 +0200 |
commit | 096e0d0a7199ec9a4059fd5ef8a06a3cf8fcae83 (patch) | |
tree | e88e612ac8836ad14abf6b6daff5f2508f0456b2 /src/crepe/Particle.cpp | |
parent | 094ce1806156e191ffb554d4e88e636421cb0242 (diff) |
created a particel system
Diffstat (limited to 'src/crepe/Particle.cpp')
-rw-r--r-- | src/crepe/Particle.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/crepe/Particle.cpp b/src/crepe/Particle.cpp index 90957db..f6bbd34 100644 --- a/src/crepe/Particle.cpp +++ b/src/crepe/Particle.cpp @@ -1,12 +1,13 @@ #include "Particle.hpp" + Particle::Particle(float lifespan, Position position, Position velocity) : lifespan(lifespan), position(position), velocity(velocity), timeInLife(0.0f) {} void Particle::update(float deltaTime) { timeInLife += deltaTime; - position.x += static_cast<int>(velocity.x * deltaTime); - position.y += static_cast<int>(velocity.y * deltaTime); + position.x += velocity.x * deltaTime; + position.y += velocity.y * deltaTime; } bool Particle::isAlive() const { |