Basically, what I am looking for is for the objects to “flash” multiple times. (by flash I mean its alpha to go up and down).
This is what I’ve got so far, but this flash is not good. (the timing is not correct, some flashes are faster than others)
local square = display.newRect(centerX, centerY, 40, 40) local function invinsibilityFrames() for i = 1, 5 do square.alpha = 0.5 timer.performWithDelay(1000, function() square.alpha = 1 end, 1) end end timer.performWithDelay(500, invinsibilityFrames, 5)
Any help would be great! Thanks!