From 096e0d0a7199ec9a4059fd5ef8a06a3cf8fcae83 Mon Sep 17 00:00:00 2001 From: jaroWMR Date: Mon, 7 Oct 2024 16:02:09 +0200 Subject: created a particel system --- src/crepe/Particle.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/crepe/Particle.cpp') 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(velocity.x * deltaTime); - position.y += static_cast(velocity.y * deltaTime); + position.x += velocity.x * deltaTime; + position.y += velocity.y * deltaTime; } bool Particle::isAlive() const { -- cgit v1.2.3