Hello
Can anyone tell me what I’m doing wrong here? Each number is meant to grow, then disappear to make way for the next growing number. But only the first number grows because the first tween, t1, seems to tween the size for all of my numbers after the first second. Yet the subject of each tween is clearly different. What silly mistake am I making?
Matt
function setup()
CountDown = {{text = "3", size = 0, opacity = 255}, {text = "2", size = 0, opacity = 255},{text = "1", size = 0, opacity = 255},{text = "GO!", size = 0, opacity = 255}}
t1 = tween(1, CountDown[1], {size = 100}, tween.easing.linear, function()
sound("Game Sounds One:Bell 2") CountDown[1].opacity = 0 end)
t2 = tween(1, CountDown[2], {size = 100}, tween.easing.linear, function() sound("Game Sounds One:Bell 2") CountDown[2].opacity = 0 end)
t3 = tween(1, CountDown[3], {size = 100}, tween.easing.linear, function() sound("Game Sounds One:Bell 2") CountDown[3].opacity = 0 end)
t4 = tween(1, CountDown[4], {size = 100}, tween.easing.linear,
function() sound("Game Sounds One:Bell 2")
CountDown[4].opacity = 0 end)
tween.sequence(t1, t2, t3, t4)
end
function draw()
background(40, 40, 50)
for i = 1, 4 do
pushStyle()
textMode(CENTER)
font("Futura-CondensedExtraBold")
fill(255, CountDown[i].opacity)
fontSize(CountDown[i].size)
text(CountDown[i].text, WIDTH/2, HEIGHT/2)
popStyle()
end
end