libraries_setup #3
@ -1,4 +1,5 @@
|
|||||||
local flip = require("src.world.common.system.flip")
|
local flip = require("src.world.common.system.flip")
|
||||||
|
local transform = require("src.world.common.component.transform")
|
||||||
|
|
||||||
local template = {}
|
local template = {}
|
||||||
|
|
||||||
@ -24,6 +25,7 @@ template.default_data = {
|
|||||||
next_trigger_frame = 1,
|
next_trigger_frame = 1,
|
||||||
run_time = 0,
|
run_time = 0,
|
||||||
trigger_frame = {1},
|
trigger_frame = {1},
|
||||||
|
position = {0, 0, 0}
|
||||||
}
|
}
|
||||||
function template.assemble(e, data)
|
function template.assemble(e, data)
|
||||||
e:give(flip.pool.pool[1], data.sfx)
|
e:give(flip.pool.pool[1], data.sfx)
|
||||||
@ -34,6 +36,7 @@ function template.assemble(e, data)
|
|||||||
e:give(flip.pool.pool[6], data.next_trigger_frame)
|
e:give(flip.pool.pool[6], data.next_trigger_frame)
|
||||||
e:give(flip.pool.pool[7], data.run_time)
|
e:give(flip.pool.pool[7], data.run_time)
|
||||||
e:give(flip.pool.pool[8], data.trigger_frame)
|
e:give(flip.pool.pool[8], data.trigger_frame)
|
||||||
|
e:give(transform.dict.position, data.position)
|
||||||
end
|
end
|
||||||
|
|
||||||
return template
|
return template
|
||||||
|
|||||||
@ -9,6 +9,7 @@ local debug_entity = require("src.world.common.template.debug_entity")
|
|||||||
local book = require("src.world.common.template.book")
|
local book = require("src.world.common.template.book")
|
||||||
|
|
||||||
local animation = require("src.world.common.component.animation")
|
local animation = require("src.world.common.component.animation")
|
||||||
|
local transform = require("src.world.common.component.transform")
|
||||||
|
|
||||||
local wrapper = world:extend()
|
local wrapper = world:extend()
|
||||||
|
|
||||||
@ -42,7 +43,7 @@ function wrapper:draw()
|
|||||||
local frame_i = v[animation.dict.frame_i].data
|
local frame_i = v[animation.dict.frame_i].data
|
||||||
local img = v[animation.dict.image_frame].data.images
|
local img = v[animation.dict.image_frame].data.images
|
||||||
if (img ~= nil) then
|
if (img ~= nil) then
|
||||||
love.graphics.draw(img[frame_i])
|
love.graphics.draw(img[frame_i], v[transform.dict.position].data[1], v[transform.dict.position].data[2])
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user