To answer your question, if you only reference the sides and collision boolean variables when the object is moving in that direction, it should help.
ieI.e. (sudopseudo-code):
if(moving right AND NOT collision on right){
move right.
}
orOr:
if(collision on right AND Dx > 0){
Dx = 0.
}
Right now what you're doing wont allow you to move at all if there's a collision.
For
For example, it seems like if the player is standing on a platform, he can move left and right, but not up and down. However, if the player runs into a wall, every frame, collisions to the left or right will register true and prevent movement along the x axis as well.
Hope this helps,
Best,
Peter