I fixed your pixel platformer! You can copy this :3 The trick is to spawn in the grey area not outside! :D And also change the Xv and Yv variables to 0 when starting!
Credit to @sourjubjub I will probably unshare this project later.