fixed all entities instanced an entity when grabbing functions from parent Entity. now it just sets metatable
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
CursedBook = Entity:new()
|
||||
CursedBook = {}
|
||||
CursedBook.type = "CursedBook"
|
||||
CursedBook.supertype = Entity.type
|
||||
CursedBook.display = Animation:new(animation.cursed_book.flying)
|
||||
setmetatable(CursedBook, Entity)
|
||||
|
||||
function CursedBook:new(x,y)
|
||||
local o = Entity:new(x,y)
|
||||
@@ -28,8 +30,12 @@ function CursedBook:new(x,y)
|
||||
o:createBox(o.body)
|
||||
|
||||
-- light
|
||||
o.light_range = 500
|
||||
--o.light = Light:new(o.pos.x,o.pos.y,o.light_range,2,hex2rgb("#fe00d1"))
|
||||
local light_data = {}
|
||||
light_data.radius = 500
|
||||
light_data.shine_radius = 0
|
||||
light_data.flicker = nil
|
||||
light_data.color = nil
|
||||
o.light = Light:new(o.pos.x,o.pos.y,light_data)
|
||||
|
||||
o:id()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user