updated
This commit is contained in:
@@ -298,7 +298,9 @@ local function physicsLoop()
|
||||
local MAX_TIME = 14.0
|
||||
|
||||
-- Per-peg cooldown to prevent vibrating stuck against one peg.
|
||||
local pegCooldown = {}
|
||||
-- Also used to track glow: peg stays lit while cooldown > 0.
|
||||
local pegCooldown = {} -- index -> time remaining
|
||||
local pegLit = {} -- index -> true while glowing
|
||||
|
||||
-- Pre-build bucket divider X positions (walls between buckets).
|
||||
-- Each divider is a thin vertical wall from bucketTop downward.
|
||||
@@ -326,10 +328,16 @@ local function physicsLoop()
|
||||
vx = vx * s; vy = vy * s
|
||||
end
|
||||
|
||||
-- Tick peg cooldowns
|
||||
-- Tick peg cooldowns; restore normal colour when glow expires
|
||||
for k, v in pairs(pegCooldown) do
|
||||
pegCooldown[k] = v - DT
|
||||
if pegCooldown[k] <= 0 then pegCooldown[k] = nil end
|
||||
if pegCooldown[k] <= 0 then
|
||||
pegCooldown[k] = nil
|
||||
if pegLit[k] then
|
||||
drawPeg(pegs[k], COL_PEG)
|
||||
pegLit[k] = nil
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- ── Peg collisions (only while above bucket zone) ───────────
|
||||
@@ -363,7 +371,8 @@ local function physicsLoop()
|
||||
vy = vy - newVn * ny
|
||||
end
|
||||
|
||||
pegCooldown[i] = 0.08
|
||||
pegCooldown[i] = 0.18 -- glow duration (s)
|
||||
pegLit[i] = true
|
||||
drawPeg(p, COL_PEG_HIT)
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user