To my surprise, I had time today. Hence, I went on and managed to meet the goals I set last time.
Linear edge panning is now a thing, which means that the closer the cursor gets to the edge of the screen, the faster the camera moves. Instead of resorting to fixed steps of ever-narrowing bands, I plugged in a swappable easing function and called it a day.
The zoom got me thinking, though. In my previous experiments, I didn't have to deal with big viewports. All my games used to have a fixed--and pretty low--resolution, so adapting the view to the browser windows size was a matter of drawing to an offscreen canvas, reading its content back, and upscaling it in the process.
This time around, I went for a strange middleware-ish solution where the camera multiplies all the coordinates it receives based on its zoom, but it doesn't thrill me whatsoever. I'll probably revisit it sometime soon.
Anyway, the next milestone is to move the camera instead of the grid, as it is now. I hope I'm gonna make it tomorrow 💪

Daily Gamedev

Do something related to your game every day!

joined 1,494 days ago

2024-04
2024-03
2024-02
2024-01
2023-12

Decade Jam

To help keep members of the Decade Jam on track with their projects!

joined 1,492 days ago