diff options
Diffstat (limited to 'Spiral.cpp')
-rw-r--r-- | Spiral.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -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) |