#include "Bullets.h" #include #include void update(const float dt, std::vector& bullets) { auto it = bullets.begin(); while (it != bullets.end()) { auto& bullet = *it; bullet.position.x += bullet.velocity.x * dt; bullet.position.y += bullet.velocity.y * dt; if (bullet.position.y > 800) it = bullets.erase(it); else ++it; } }