Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Collision Problem  (Read 852 times)

0 Members and 1 Guest are viewing this topic.

Pwishie

  • Newbie
  • *
  • Posts: 6
    • View Profile
    • Email
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...

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: Collision Problem
« Reply #1 on: April 24, 2017, 06:32:49 am »
If you include windows.h (directly or indirectly), then either do it after everything else, or define the NOMINMAX symbol in your preprocessor options.
Laurent Gomila - SFML developer

 

anything