summaryrefslogtreecommitdiffhomepage
path: root/Spiral.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Spiral.cpp')
-rw-r--r--Spiral.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/Spiral.cpp b/Spiral.cpp
index 636a6b2..cfa02c6 100644
--- a/Spiral.cpp
+++ b/Spiral.cpp
@@ -28,10 +28,11 @@ SpiralSystem::update(const float dt)
bullet.angle -= 2.0;
bullet.redirect *= bullet.redirect_decrease;
}
- float velovity_x = std::cos(angle * M_PI);
- float velovity_y = std::sin(angle * M_PI);
+ float velocity_x = bullet.velocity * std::cos(bullet.angle * M_PI);
+ float velocity_y = bullet.velocity * std::sin(bullet.angle * M_PI);
bullet.position.x += velocity_x * dt;
bullet.position.y += velocity_y * dt;
+ //bullet.position.x += 5*dt;
const bool y_exceeded = bullet.position.y < min_height || bullet.position.y > max_height;
const bool x_exceeded = bullet.position.x < min_width || bullet.position.x > max_width;
if (y_exceeded || x_exceeded)