Hi.
I'm using SFML.Net, the c# bindings for sfml, and I'm getting a weird logic error.
Here's my code:
public static bool IsColliding(Entity enity1, Entity entity2)
{
if (enity1.GetSprite().GetGlobalBounds().Intersects(entity2.GetSprite().GetGlobalBounds()))
{
Console.WriteLine(enity1.GetSprite().GetGlobalBounds().Intersects(entity2.GetSprite().GetGlobalBounds()));
Console.WriteLine(enity1.GetSprite().GetGlobalBounds().Left + ", " + entity2.GetSprite().GetGlobalBounds().Left);
Console.WriteLine(enity1.GetSprite().GetGlobalBounds().Top + ", " + entity2.GetSprite().GetGlobalBounds().Top);
return true;
}
return false;
}
(how do I format code?)
As you can see, it's a simple function, which returns true if the sprites collide, and false if they don't. I also added some writeline() statements for debug.
Weirdly, this is the output I get:
True
342, 260
-40, 350
How? How is it returning true if the rectangles are obviously not intersecting?
(Also, this is my first time at the forum, so forgive me if this is not a correct type of problem in the correct type of section, etc.