声明方法和调用方法统一用冒号
对于属性的调用全部用点号
function Class:new(x,y)
local temp
=
{}
setmetatable(temp, Class)
temp.x
=
x
temp.y
=
y
return
temp
end
声明方法和调用方法统一用冒号
对于属性的调用全部用点号
function Class:new(x,y)
local temp
=
{}
setmetatable(temp, Class)
temp.x
=
x
temp.y
=
y
return
temp
end