How do I optimize this code?
variable = 1
moveLine = function ()
if variable == 1 then
first = color_1.color
second = color_2.color
elseif variable == 2 then
first = color_2.color
second = color_3.color
end
variable = variable + 1
end
The function is alot longer and that is why I could use an easier way 🙂
You should be storing your colors in an array: