libraries_setup #3

Merged
fnicon merged 13 commits from libraries_setup into main 2026-03-18 14:29:14 +00:00
2 changed files with 5 additions and 1 deletions
Showing only changes of commit 0395eb7c17 - Show all commits

View File

@ -1,4 +1,5 @@
local flip = require("src.world.common.system.flip")
local transform = require("src.world.common.component.transform")
local template = {}
@ -24,6 +25,7 @@ template.default_data = {
next_trigger_frame = 1,
run_time = 0,
trigger_frame = {1},
position = {0, 0, 0}
}
function template.assemble(e, data)
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[7], data.run_time)
e:give(flip.pool.pool[8], data.trigger_frame)
e:give(transform.dict.position, data.position)
end
return template

View File

@ -9,6 +9,7 @@ local debug_entity = require("src.world.common.template.debug_entity")
local book = require("src.world.common.template.book")
local animation = require("src.world.common.component.animation")
local transform = require("src.world.common.component.transform")
local wrapper = world:extend()
@ -42,7 +43,7 @@ function wrapper:draw()
local frame_i = v[animation.dict.frame_i].data
local img = v[animation.dict.image_frame].data.images
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