Lua面向對象的實現

TSprite = { x = 0, y = 0, } function TSprite:setPosition(x, y) self.x = x self.y = y end function TSprite:display() print(self.x .. ", " .. self.y) end local who = TSprite TSprite = nil who
相關文章
相關標籤/搜索