Posted June 16, 2025 by Chatofor
#Dev #Gamedev #Playdate #Lua
I finally managed to find a way to have both a nice and smooth focus/unfocus of the sprites AND have it on the playdate without too much slowing.
Each sprite gets an ID and a "layer" (depth) when it spawns, which determines its vertical position for the crowd effect. The direction and flipped image are also set at spawn, saving processing time during rendering.
The focus effect is controlled by the crank: the crank position defines a "focal layer," and each sprite's blur is calculated based on how far its layer is from the focal layer. This means blur is computed per-sprite each frame, but with a simple and efficient rule.
I also realized that you don't need a huge crowd for the scene to feel alive, so I reduced the maximum number of sprites, which keeps the game smooth on device.