*collide is image for collision
*clr is int value for pixel;
*pX is player's x coordinate
*bgx is the backgrounds location relative to the player or (0,0)
*pY is player's y coordinate
How it works:
You have a background Image that is a picture of the landscape your going to be playing on, Then you have a near identical picture that is all the collide-able spots on the level colored red. clr is the pixel at the players location (shifted to a side of the player [u/d/l/r]). If that pixel the player is touching is -65536 (the color red) than the player cannot move any further in that direction.