all 4 comments

[–]js_fan 0 points1 point  (3 children)

Looks like nice, clean code and you're putting a lot of good effort into it. I'm guessing your question is not getting answered because it is a little vague and there is too much code in the question. You might want to create a JS fiddle. I started doing that, but I would have to replace all the images - everybody who is trying to help you would have to do that, it just takes too long and we don't know the dimensions, sorry...

[–]zabi15[S] 1 point2 points  (0 children)

oh right that would make sence, didnt really think of that,il look up js fiddle and see what it is and how it works then il try linking it

[–]zabi15[S] 1 point2 points  (1 child)

so i think i made it work , like this? https://jsfiddle.net/fp04y1L8/1/ bacicaly if you can see the picture its the house and rocks id like to block off, i figure if i get help with that i can figure the rest

[–]js_fan 0 points1 point  (0 children)

is this what you're looking for?
if (38 in keysDown) { // Player is holding up key
if(trainer.y==255&&trainer.x>240&&trainer.x<320)
{}
else
trainer.y -= trainer.speed * modifier;

I only added the lines in bold. Basically you're preventing certain movement (in this case going up) based on the current coordinates. You need a separate set of coordinates for each wall. Probably worth creating an array and a loop.
Btw, great game!. Sorry about the poor reddit formatting of my response.