Having a moving character stop when he hits objects in an rpg?

http://www.haxorleet.com/rpg.html

how can i have my little person stop when he hits an object i place in there?

also, is there a way i can have him interact with that object if i he gets up next to it and presses spacebar?