Thanks for the input. I played with it a bit more and here's what I have (with more legibility).
if (sf::Mouse::isButtonPressed(sf::Mouse::Right))
{
for (std::list<sf::Sprite>::iterator it = BGCollTiles.begin(); it != BGCollTiles.end();)
{
if(it->getGlobalBounds().contains(sf::Mouse::getPosition(App).x,sf::Mouse::getPosition(App).y))
{
BGCollTiles.erase(it);
}
else
++it;
}
}
Now it compiles, but right-clicking a tile crashes the program. Clicking anywhere else works fine. Also, I failed to mention that I am using Visual Studio 2009, so I don't have access to C++11. Is there any way I can pull this off without it?
Sorry, i'm still new to C++ so go easy on me, haha.