1
General / Collision Problem
« on: April 24, 2017, 04:35:52 am »
Accidentally posted this on the wrong board earlier today. Sorry about that
I keep getting strange error from Visual Studio when I try to add collision detection to my game. There errors all look like similar to this:
"...sfml\graphics\rect.inl(114): error C2589: '(': illegal token on right side of '::'"
I'm doing collision detection in the exact same way I've always done it, and trying other methods doesn't work either.
Relevant Code:
if (isCollide(spr, spr2)) {
std::cout << "You win!!!! \n";
}
bool isCollide(sf::Sprite spr1, sf::Sprite spr2) {
return spr1.getGlobalBounds().intersects(spr2.getGlobalBounds());
}
I was wondering if it's an issue with how I set up SFML in VS...
I keep getting strange error from Visual Studio when I try to add collision detection to my game. There errors all look like similar to this:
"...sfml\graphics\rect.inl(114): error C2589: '(': illegal token on right side of '::'"
I'm doing collision detection in the exact same way I've always done it, and trying other methods doesn't work either.
Relevant Code:
if (isCollide(spr, spr2)) {
std::cout << "You win!!!! \n";
}
bool isCollide(sf::Sprite spr1, sf::Sprite spr2) {
return spr1.getGlobalBounds().intersects(spr2.getGlobalBounds());
}
I was wondering if it's an issue with how I set up SFML in VS...