Jump to content

View more

Image of the Day

#ld38 #screenshotsaturday Mimosa Fizz action gif #2 https://t.co/TUzdppvfUL
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

SDL Collision Library

4: Adsense

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   

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;
}


#22 Rob Loach   Members   

1504
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   

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.