for reference, it's spelled collision ;]
i don't know what's wrong with your code, but i'll show you the function i use, it works good for me:
bool boxCollision(float object1Bottom,float object1Top,float object1Left,float object1Right,float object2Top,float object2Bottom,float object2Left,float object2Right){ //Y BOX CHECK if(object1Left <= object2Right && object1Right >= object2Left) { if(object1Top >= object2Bottom && object1Top <= object2Bottom + 2) { return true; } if(object1Bottom <= object2Top && object1Bottom >= object2Top - 2) { return true; } } //X BOX CHECK if(object1Top >= object2Bottom && object1Bottom <= object2Top) { if(object1Left <= object2Right && object1Left >= object2Right - 2) { return true; } if(object1Right >= object2Left && object1Right <= object2Left + 2) { return true; } } return false;}
maybe a little confusing, but good enough. (sorry that there's so many parameters and the codes messy, it was my first AABB function.)
hope that helps
--nathan