When I press down the right and left arrow keys, instead of moving left and right as expected, the character jerks forward, stops, and restarts, all while I have the button pressed down.
I have the whole game up here: https://codepen.io/alexis-lee-ann-stockdale/pen/qzvrop
I think the problem is somewhere in the update function or in the keys function.
Here is was I've written in the update function to move the character:
game.player.y += game.player.vely;
game.player.posx += game.player.velx;
game.player.velx *= game.world.friction;
game.player.vely += game.world.gravity;
If this is too invovled a question to answer, could you please point me to a tutoring service that I could perhaps use? Thank you in advance.