Hello,
I would like to understand how I can trigger an animation limited in time.
So the below code runs ok and shows a line that is going "down" but I would like to listen to a button press and be able to define the amount of drop of the line (and actually see the animation).
-- title: game title -- author: game developer -- desc: short description -- script: lua local t=0 local x=96 local y=24 local x1=20 local y1=20 local x2=40 local y2=40 local color=5 function UpdateLines() x1=x1+1 y1=y1+1 x2=x2+1 y2=y2+1 end function Drawlines() line(x1,y1,x2,y2,color) end function TIC() cls() Drawlines() UpdateLines() end
If I add something like
if btnp(4) then for i=1,10,1 UpdateLines() end end
it will directly go to the dropped stated and not show the animation of the line going down. How can I do this?
Thanks!
Matth