stack
Keeps "+N" score popups readable when many arrive at once. `Stack.add(list, popup, now, { mode, cap })` inserts a popup, merging a small hit into the last one at the same spot when that spot is crowded or full (the merged popup reads "+150 x5"). `Stack.place(list, now, sizeOf, {…
stack
Keeps "+N" score popups readable when many arrive at once. Stack.add(list, popup, now, { mode, cap }) inserts a popup, merging a small hit into the last one at the same spot when that spot is crowded or full (the merged popup reads "+150 x5"). Stack.place(list, now, sizeOf, { mode, zone, screen }) gives every live popup its own row: upward from the spot it was scored at (stack, merge), or a list in the popups zone (column); older popups shrink and leave sooner when crowded; free keeps the old overlapping placement. Stack.clear(placed) checks no two rows overlap. The HUD runs it for every popup style (the popupStack setting).
local Stack = require("scoreKit.stack")
local list = {}
Stack.add(list, { amount = 10, kind = "normal", born = now, life = 1.1, sx = 640, sy = 360 }, now, { mode = "stack" })
local placed = Stack.place(list, now, function(p) return 90, 32 end, { mode = "stack", screen = { w = 1280, h = 720 } })
Scoped to this part · feeds back into the world's score.