diff --git a/main.lua b/main.lua index 6718b3b..9866e91 100644 --- a/main.lua +++ b/main.lua @@ -34,8 +34,8 @@ end --load room list local rooms = require("rooms") ---current_room = rooms['Alley'] -current_room = rooms['Vivarium'] +current_room = rooms['Alley'] +--current_room = rooms['Vivarium'] function set_room_raw(r) current_room:onexit() diff --git a/obj/note.lua b/obj/note.lua deleted file mode 100644 index 6b6ef1d..0000000 --- a/obj/note.lua +++ /dev/null @@ -1,13 +0,0 @@ -local entity = require("entity") -local window = require("window") -local note = require("room/note") - -local m = entity:from{ - text = "sample text", -} - -m.mousepressed = window.mousepressed(function (self, x, y, button) - log:log("It reads:" .. self.text) -end) - -return m diff --git a/obj/sign.lua b/obj/sign.lua new file mode 100644 index 0000000..20928f7 --- /dev/null +++ b/obj/sign.lua @@ -0,0 +1,23 @@ +local entity = require("entity") +local window = require("window") + +local m = entity:from{ + width = 40, + height = 20, + text = "sample text", +} + +m.draw = window.draw(function (self) + love.graphics.rectangle('fill', 0, 0, self.width, self.height) + + love.graphics.setColor(0, 0, 0) + for i = 1, self.height/5 - 1 do + love.graphics.line(5, 5*i, self.width - 5, 5*i) + end +end) + +m.mousepressed = window.mousepressed(function (self, x, y, button) + log:log("It reads: " .. self.text) +end) + +return m diff --git a/obj/sundial.lua b/obj/sundial.lua index 32e9b52..13c9c8f 100644 --- a/obj/sundial.lua +++ b/obj/sundial.lua @@ -5,7 +5,6 @@ local sundial = require("room/sundial") local m = entity:from{ width = 60, height = 60, - lines = {'fill', {30, 30, 60, 40, 60, 50, 30, 60, 0, 50, 0, 40}}, } local install = m.install @@ -18,6 +17,13 @@ function m:install(room, x, y) 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) diff --git a/room/sundial_alley.lua b/room/sundial_alley.lua index c559658..70116f3 100644 --- a/room/sundial_alley.lua +++ b/room/sundial_alley.lua @@ -3,26 +3,31 @@ local edge = require("edge") local sundial = require("obj/sundial") local keypad = require("obj/keypad") local door = require("obj/door") +local sign = require("obj/sign") local m = room:new() sundial:from{ numbers = {3, 5, 8, 2, 7}, -}:install(m, 140, 160) +}:install(m, 135, 155) local d = door:from{ destination = 'Vivarium', } -d:install(m, 80, 60) d.mousepressed = d.keypadMode +d:install(m, 80, 60) keypad:from{ code = 35827, oncorrect = function (self) d.locked = false end, -}:install(m, 160, 90) +}:install(m, 165, 110) + +sign:from{ + text = "If you desire to enter, you should follow the shadow" +}:install(m, 160, 80) edge.set(m, 'down', "Alley")