I am really confused here.
Why I can’t add the function to the table element?
Yo can see the problem in the example below:
local clouds = {}
for i=1,3 do
clouds[i] = display.newImage(...etc...)
function clouds[i]:moveCloud() self.x = self.x + (self.speed \* self.direction)
if self.x \> 640 or self.x \< - self.width then
self.x = self.x + (640 \* self.direction)
self.speed = math.random(1, 10)
end
end
end
Thanks [import]uid: 101952 topic_id: 31755 reply_id: 331755[/import]