enemy = {}
function enemy:new(x,y)
Square = display.newRoundedRect( 0, 0, 80, 80,15)
Square.x = x
Square.y = y
function Square:change_colour(event)
local red = math.random()
local blue = math.random()
local green = math.random()
self:setFillColor( red,blue,green )
end
timer.performWidthDelay(1000, Square.Line)
return Square
end
return enemy
How would I implement a timer for the function “Line” to work within a class?