The below sketch features 4 examples of player movement using keyboard and mouse input in p5.js.
The repository for this site can be found here:
https://github.com/Chelsea-Thompto-Teaching-Examples/game-movement-p5js
This template was rewritten as part of a larger project, byhand.website. This project is an open guide to creating websites by hand and can be explored here: