garden/obj/sundial.lua

31 lines
699 B
Lua

local entity = require("entity")
local window = require("window")
local sundial = require("room/sundial")
local m = entity:from{
width = 60,
height = 60,
}
local install = m.install
function m:install(room, x, y)
self.sundial = sundial:from{
numbers = self.numbers,
room = room,
}
install(self, room, x, y)
end
m.draw = window.draw(function (self)
love.graphics.ellipse('fill', 30, 45, 30, 15, 12)
love.graphics.polygon('fill', 30, 45, 55, 45, 30, 15)
love.graphics.setColor(0, 0, 0)
love.graphics.polygon('fill', 30, 45, 55, 45, 40, 55)
end)
m.mousepressed = window.mousepressed(function (self)
set_room_raw(self.sundial)
end)
return m