so you don't recommend doing this -> class Bullet : public sf::Drawable {}
How else can I make it drawable?
That's perfectly okay, classes like
sf::Transformable,
sf::Drawable and
sf::NonCopyable are meant to be used as base classes. But I see a lot of people inheriting
sf::Sprite etc. to add their own functionality, while that was never a design intended by the authors.
my create/move bullet function now looks like this
Looks good, cool that you're using the erase-remove-idiom!
I don't think
std::shared_ptr is necessary here -- why not simply
std::vector<Bullet>? Some copies won't hurt, and it makes a lot easier. If you actually need pointers, you should resort to
std::unique_ptr, as you're not sharing ownership.
Furthermore, you can simplify
for (auto i = bullets.begin(); i != bullets.end(); i++)
{
(*i)->Update(bulletSpeed.asSeconds());
}
as follows:
for (Bullet& bullet : bullets) // assumes std::vector<Bullet>
bullet.update(bulletSpeed); // misleading name, it's not a speed