diff --git a/obj/note.lua b/obj/note.lua index 72450ce..6b6ef1d 100644 --- a/obj/note.lua +++ b/obj/note.lua @@ -6,16 +6,8 @@ local m = entity:from{ text = "sample text", } -local install = m.install -function m:install(room, x, y) - self.note = note:from{ - text = self.text, - room = room - } - - install(self, room, x, y) -end - -m.mousepressed = window.portal('note') +m.mousepressed = window.mousepressed(function (self, x, y, button) + log:log("It reads:" .. self.text) +end) return m diff --git a/room/note.lua b/room/note.lua deleted file mode 100644 index d098504..0000000 --- a/room/note.lua +++ /dev/null @@ -1,22 +0,0 @@ -local window = require("window") -local room = require("room") -local edge = require("edge") - -local m = room:new() - -local from = m.from -function m:from(t) - local n = from(self, t) - - edge.set(n, 'down', n.room) - - return n -end - -m.draw = window.draw(function (self) - love.graphics.printf(self.text, 80, 40, 160) - - self.edges[1]:draw() -end) - -return m