diff options
author | Michal <michrydz@wp.pl> | 2022-04-24 19:26:25 +0200 |
---|---|---|
committer | Michal <michrydz@wp.pl> | 2022-04-24 19:26:25 +0200 |
commit | 4c3eca4427841730501b24b25cc4ff2a36f9f070 (patch) | |
tree | 1362df9458ffb966e21a2e1d701924ddc5a20e2b /Spiral.cpp | |
parent | 6f6b09dcf2c5306471c3febfa658bbd984664884 (diff) | |
download | bullethell2022-4c3eca4427841730501b24b25cc4ff2a36f9f070.zip bullethell2022-4c3eca4427841730501b24b25cc4ff2a36f9f070.tar.gz bullethell2022-4c3eca4427841730501b24b25cc4ff2a36f9f070.tar.bz2 |
Fix spiral movementspiralbullet
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) |