Lines 74 to 258 is the function that moves the hero around. It is a lot of code, but what you are trying to do is actually fairly involved. Please give it a read and let me know if you have questions.