Use WASD or the arrow keys to move. Download to see how the colliding with the trees thing works. It's actually quite simple. Everytime you try to move him he first saves his current coordinates and then moves. If it is touching a tree it goes back to it's previous location where it did not.