So this is my square.lua
[lua]module(…,package.seeall)
local square = {}
local square_mt = {__index = square}
function square.new()
local newSquare
newSquare = display.newImage(“square.png”)
newSquare:setReferencePoint(display.CenterReferencePoint)
newSquare.x = 10
newSquare.y = 20
return setmetatable(newSquare, square_mt)
end
function square:animate()
transition.to(square, { time=7000, y = 50, onComplete = animate})
end
return square[/lua]
and this is my main.lua
[lua]local square = require(“square”)
local square1 = square.new()
square1:animate()[/lua]
Shouldn’t this work? What am I missing? [import]uid: 106739 topic_id: 18458 reply_id: 318458[/import]
[import]uid: 106739 topic_id: 18458 reply_id: 71008[/import]