I'm trying to create ncar table with 2 different functions: setup ans main_frame
local ncar=
{
img=display.newImageRect("test_car.png",50,120,true);
x=0;
y=0;
frames=0;
setup=function(self)
return self;
end
main_frame=function(self)
self.frames=self.frames+1;
return function(event)
self.img.x=self.x;
self.img.y=self.y;
end
end
}
But compiler says that he expects to see '}' where the second function (main_frame in this case) starts, when I add it. What are the reasons?