add class() for easy definition of classes

This commit is contained in:
binarycat
2022-03-16 19:59:42 -04:00
parent d20e5392f8
commit 1549976382
4 changed files with 14 additions and 9 deletions

View File

@@ -1,6 +1,5 @@
LoadedObjects.Entities = {}
Entity = {}
Entity.type = "Entity"
Entity = class(nil, {type = "Entity"})
function Entity:new(x,y)
local o = {}
@@ -26,7 +25,6 @@ function Entity:new(x,y)
o.sprite_flip = { x = 1, y = 1}
setmetatable(o, self)
self.__index = self
return o
end