Recommend you play here for pointerlock: https://experiments.turbowarp.org/pointerlock/802195921
Thanks to griffpatch for the raycasting tutorial And doom for sprites