Jump to content

  • Log In with Google      Sign In   
  • Create Account


#Actualsuperman3275

Posted 25 September 2012 - 10:07 AM

Well, in SFML you set floatrects (Rectangles that can have coordinates that are floating point values) up around the sprite.
Something along the lines of:
sf::floatrect floatrect1;
sf::floatrect floatrect2;
//
// SET FLOATRECTS COORDS TO SPRITES
//
if (floatrect1.Intersects(floatrect2))
{
	  //COLLISION
}
if there isn't an intersect function for bounding boxes, write your own using the coordinates of the floatrects.
(I didn't write down the specific code because I didn't have time, also you might not know SFML/C++)

#2superman3275

Posted 25 September 2012 - 10:07 AM

Well, in SFML you set floatrects (Rectangles that can have coordinates that are floating point values) up around the sprite.
Something along the lines of:
sf::floatrect floatrect1;
sf::floatrect floatrect2;
//
// SET FLOATRECTS COORDS TO SPRITES
//
floatrect1.Intersects(floatrect2);
if there isn't an intersect function for bounding boxes, write your own using the coordinates of the floatrects.
(I didn't write down the specific code because I didn't have time, also you might not know SFML/C++)

#1superman3275

Posted 25 September 2012 - 10:06 AM

Well, in SFML you set floatrects (Rectangles that can have coordinates that are floating point values) up around the sprite.
Something along the lines of:
floatrect 1;
floatrect2;
//
// SET FLOATRECTS COORDS TO SPRITES
//
floatrect1.Intersects(floatrect2);
if there isn't an intersect function for bounding boxes, write your own using the coordinates of the floatrects.
(I didn't write down the specific code because I didn't have time, also you might not know SFML/C++)

PARTNERS