Streak Club is a place for hosting and participating in creative streaks.
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 💪
joined 1,699 days ago
Post a comment