The SDL forums have moved to discourse.libsdl.org.
This is just a read-only archive of the previous forums, to keep old links working.


SDL Forum Index
SDL
Simple Directmedia Layer Forums
collision detection acting strange.
LAURENT*


Joined: 06 Jan 2013
Posts: 32
Goal
I'm having a small problem with my collision detection. This started when I got the bright idea to replace a bool function with and int type function. Anyways I want to check the collision of 2 sets of object in a specific way. The first set is the "wall tile base" & "land pad" and the second set is the "wall tile" and "character". I want to check the collision between the "wall tile base" and "land pad" first then check the collision of the "wall tile" and "character" second.

definition
The "wall tile base" object is the x and y coordinated of a collision box and the "wall tile" object is the z coordinate. The "land pad" object is the x and y coordinates and the "character" object is the z coordinates. The "wall tile" objects shares the x value with the "wall tile bade" and so does land pad and character objects.

Things you need to know
*The tile objects are apart of an array. Each array element creates 2 collision boxes, one for the wall tile base and one for the wall tile.
* the function.cpp resources is the main source of the problem
* collision detection boxes of the character and land are found in the move.cpp file.


This is my project file, the code has been broken up into pieces if you are unfamiliar with working with multiple sources file please send me a request to combine them into one source file.
https://www.dropbox.com/s/em7fuwbfedlfs5y/Protype2.zip?dl=0