Learning how to use the debugger is crucial, it is the only way to properly debug your code and solve all kinds of problems. Trying to fix code just by staring at it is not really efficient
I don't know which IDE you use, but you should easily find debugger tutorials for the most common ones (Visual Studio, Code::Blocks, ...). To debug your function, you only need simple things:
- run with debugger attached
- break at the beginning of the function
- run the function step by step
- whenever a collision test occurs, watch both the shape's and sprites' bounding rects (you'll probably need to store them in local variables so that your debugger can read them easily)
- find out why it doesn't return the expected result