For example,
Object Class
objectClass = {}
objectClass.new = function(...)
newObject = {}
newObject.getVariable = function(self)
return self.variable
end
return newObject
end
return objectClass
Main Fileobject = require('objectClass') -- The way I do it in love2d
myObject = object.new(...)
myObject:getVariable()
...etc
That's object oriented, and works fine.
I personally am not a big fan of metatables and try to avoid them wherever possible.











