The easy way is to do a system compare in the Y of your player and the Tree for example.
put the image point of the tree at the bottom of the base of the tree
system every tick
->player.Y >= tree.Y - player move to top
else player move to bottom
this will always put the player in front of the tree when he's lower than the tree's Y value and appear in front of it.