   Collision detection in SDL. Is there a clever way to do this?
  Hi guys :)I'm playing around with a platformer style level in SDL. Its super tiny and strictly for learning. I've read through the Lazy Foo tutorials but was wondering if there is an efficient way to do the following:I have a little sprite character who is blitted to a rectangle. I then have three "blocks" of different heights that are created with rectangles as well. Now my question is, is there an easy way to detect collision with all three blocks? Right now I have a mess that looks like this:if( ( character.x < 0 ) || ( character.x + BOX_WIDTH > SCREEN_WIDTH ) || ( check_collision( character, wall[1] ) ) || ( check_collision( character, wall[2] ) ) || ( check_collision( character, wall[3] ) )) I know there has to be a better way I'm just not thinking clearly. What my goal is is to be able to have my character class detect its own collisions with any of the object classes (like boxes and walls). Anyone have any suggestions?   
  What I would personally do is a Pixel-perfect collision check with the wall and the sprite. For example, every frame we check if the pixel on the wall surface is fully transparent or not. If it is not transparent, react to the collision accordingly.LazyFoo.net has a number of SDL collision articles, one of them should be pixel-perfect collision with a point and an SDL surface if I remember correctly.Anyway, good luck with your project! :)   