If you don't know the walls position or scal, then you might want to readpixel the corners of the players square.
And do the check before you actually move the player, so that you don't get the collision after the player is "inside" the wall.
And do the check before you actually move the player, so that you don't get the collision after the player is "inside" the wall.