diff --git a/game/src/world/common/template/book.lua b/game/src/world/common/template/book.lua index b350f67..4003813 100644 --- a/game/src/world/common/template/book.lua +++ b/game/src/world/common/template/book.lua @@ -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 diff --git a/game/src/world/race/init.lua b/game/src/world/race/init.lua index 53d3460..d4b86b9 100644 --- a/game/src/world/race/init.lua +++ b/game/src/world/race/init.lua @@ -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