git repos / saland

commit 7376822b

sago007 · 2018-07-28 19:05
7376822b97e646ee65742aae6390b1d471eef648 patch · browse files
parent 84bbabc5a9371fb9d2cf8ab65c9910f64468334a

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() {