Jump to content

  • Log In with Google      Sign In   
  • Create Account

SDL Collision Library


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
22 replies to this topic

#21 mattst88   Members   -  Reputation: 142

Like
0Likes
Like

Posted 06 June 2006 - 10:41 AM

This function is all I've ever needed:

int Collide(const SDL_Rect * a, const SDL_Rect * b) {
if ( b->x + b->w < a->x ) return 0;
if ( b->x > a->x + a->w ) return 0;
if ( b->y + b->h < a->y ) return 0;
if ( b->y > a->y + a->h ) return 0;
return 1;
}


Sponsor:

#22 Rob Loach   Moderators   -  Reputation: 1500

Like
0Likes
Like

Posted 07 June 2006 - 04:06 AM

Just a quick note that SDL_collide has moved to SourceForge.

Rob Loach [Website] [Projects] [Contact]

#23 somebodykulj   Members   -  Reputation: 100

Like
0Likes
Like

Posted 02 April 2008 - 09:26 PM

DO any of you guys know of a collision function for mario type games? for non tile objects, see i have made a good tile collision system but i messed up big triing to follow those N tutorials... SO is there a SDL example? or code that some would like to share with me?




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS