Regarding your sticky wall issue, you need to find out the wall's "normal", that is, the vector it uses to push back against the player, and use it to only nullify the movement components that push it, not the rest.
As a conceptual example, in an axis-aligned environment (All walls are 90º from each other, as if drawn on an square grid) where +X is right and +Y is up, a right facing wall would nullify -X movement, but not the rest.
In the following off the top of my head code, colliding with the wall sets the appropriate isColliding*
flag to true
based on the orientation of the wall, so when the player attempts to move:
void movePlayer(int newXvelocity, int newYvelocity)
if( (newXvelocity > 0 && isCollidingRight()) || (newXvelocity < 0 && isCollidingLeft()) )
playerXvelocity = 0;
playerXvelocity = newXvelocity;
if( (newYvelocity > 0 && isCollidingUp()) || (newYvelocity < 0 && isCollidingDown()) )
playerYvelocity = 0;
playerYvelocity = newYvelocity;
You should really take a look at vector arithmetic, though, specially if you don't want axis-aligned walls.