Better
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
local Cube = {}
|
||||
Cube.__index = Cube
|
||||
|
||||
function Cube.new()
|
||||
local self = setmetatable({}, Cube)
|
||||
self.id = entityAdd()
|
||||
local pos = entityPositionAdd(self.id)
|
||||
pos.x = 0
|
||||
pos.y = 0
|
||||
pos.z = 0
|
||||
entityMeshAdd(self.id)
|
||||
local mat = entityMaterialAdd(self.id)
|
||||
mat.color = colorWhite()
|
||||
return self
|
||||
end
|
||||
|
||||
function Cube:dispose()
|
||||
entityRemove(self.id)
|
||||
end
|
||||
|
||||
return Cube
|
||||
Reference in New Issue
Block a user