Platformer game in javascript