Change default room drawing

This commit is contained in:
백현웅 2025-01-07 20:08:08 +09:00
parent 82c0976e3c
commit a96f8e1aa3

View file

@ -7,7 +7,13 @@ local entity = require('entity')
-- - objects
-- - edges
local room = entity:from{
background = love.graphics.newImage("res/defaultbg.png"),
lines = {
{'line', 0, 0, 120, 80},
{'line', 320, 0, 200, 80},
{'line', 0, 240, 120, 160},
{'line', 320, 240, 200, 160},
{'fill', 120, 80, 200, 80, 200, 160, 200, 80},
},
}
local from = room.from
@ -31,7 +37,7 @@ end
room.mousepressed = window.propagate{'edges', 'objects'}
function room:draw()
love.graphics.draw(self.background, 0, 0)
self:draw_lines(self.lines)
for i, v in ipairs(self.objects) do
v:draw()