jobel
I did that version a few weeks ago when someone was trying to make a large universe... so I thought I would try to make a system that was infinite but could have different space regions ready to scroll on to the screen based on where you were.
that is why I added the Z key to zoom out, and the C key to show solid colors so he could see how the tiles rotated under you...
Develop games in your browser. Powerful, performant & highly capable.
Lol, ok I thought you were doing a platformer.
The generic formula for both xy coordinates:
scroll to lerp(scrollx,players.x+cos(playersangle)*playerspeed,speed*dt) lerp(scrolly,players.y+sin(playersangle)*playerspeed,speed*dt)