aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/Particle.cpp
diff options
context:
space:
mode:
authorjaroWMR <jarorutjes07@gmail.com>2024-10-07 16:02:09 +0200
committerjaroWMR <jarorutjes07@gmail.com>2024-10-07 16:02:09 +0200
commit096e0d0a7199ec9a4059fd5ef8a06a3cf8fcae83 (patch)
treee88e612ac8836ad14abf6b6daff5f2508f0456b2 /src/crepe/Particle.cpp
parent094ce1806156e191ffb554d4e88e636421cb0242 (diff)
created a particel system
Diffstat (limited to 'src/crepe/Particle.cpp')
-rw-r--r--src/crepe/Particle.cpp5
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 {