commit 7376822b
Projectiles are moving
Changed files
| M | src/saland/Game.cpp before |
diff --git a/src/saland/Game.cpp b/src/saland/Game.cpp
index 48f11aa..ab91576 100644
--- a/src/saland/Game.cpp
+++ b/src/saland/Game.cpp
@@ -369,7 +369,10 @@ static void UpdateProjectile(Projectile *entity, float fDeltaTime) {
entity->timeToLive -= fDeltaTime;
if (entity->timeToLive < 0.0f) {
entity->removeMe = true;
+ return;
}
+ entity->X -= entity->directionX*fDeltaTime*entity->velocity/320.0f;
+ entity->Y -= entity->directionY*fDeltaTime*entity->velocity/320.0f;
}
void Game::Update() {