Add hint in Sundial Alley
This commit is contained in:
		
							parent
							
								
									755f1889c4
								
							
						
					
					
						commit
						e89fa5f15c
					
				
					 5 changed files with 40 additions and 19 deletions
				
			
		
							
								
								
									
										4
									
								
								main.lua
									
										
									
									
									
								
							
							
						
						
									
										4
									
								
								main.lua
									
										
									
									
									
								
							| 
						 | 
					@ -34,8 +34,8 @@ end
 | 
				
			||||||
--load room list
 | 
					--load room list
 | 
				
			||||||
local rooms = require("rooms")
 | 
					local rooms = require("rooms")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
--current_room = rooms['Alley']
 | 
					current_room = rooms['Alley']
 | 
				
			||||||
current_room = rooms['Vivarium']
 | 
					--current_room = rooms['Vivarium']
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function set_room_raw(r)
 | 
					function set_room_raw(r)
 | 
				
			||||||
    current_room:onexit()
 | 
					    current_room:onexit()
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										13
									
								
								obj/note.lua
									
										
									
									
									
								
							
							
						
						
									
										13
									
								
								obj/note.lua
									
										
									
									
									
								
							| 
						 | 
					@ -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
 | 
					 | 
				
			||||||
							
								
								
									
										23
									
								
								obj/sign.lua
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										23
									
								
								obj/sign.lua
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
					@ -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
 | 
				
			||||||
| 
						 | 
					@ -5,7 +5,6 @@ local sundial = require("room/sundial")
 | 
				
			||||||
local m = entity:from{
 | 
					local m = entity:from{
 | 
				
			||||||
    width = 60,
 | 
					    width = 60,
 | 
				
			||||||
    height = 60,
 | 
					    height = 60,
 | 
				
			||||||
    lines = {'fill', {30, 30, 60, 40, 60, 50, 30, 60, 0, 50, 0, 40}},
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
local install = m.install
 | 
					local install = m.install
 | 
				
			||||||
| 
						 | 
					@ -18,6 +17,13 @@ function m:install(room, x, y)
 | 
				
			||||||
    install(self, room, x, y)
 | 
					    install(self, room, x, y)
 | 
				
			||||||
end
 | 
					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)
 | 
					m.mousepressed = window.mousepressed(function (self)
 | 
				
			||||||
    set_room_raw(self.sundial)
 | 
					    set_room_raw(self.sundial)
 | 
				
			||||||
end)
 | 
					end)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -3,26 +3,31 @@ local edge = require("edge")
 | 
				
			||||||
local sundial = require("obj/sundial")
 | 
					local sundial = require("obj/sundial")
 | 
				
			||||||
local keypad = require("obj/keypad")
 | 
					local keypad = require("obj/keypad")
 | 
				
			||||||
local door = require("obj/door")
 | 
					local door = require("obj/door")
 | 
				
			||||||
 | 
					local sign = require("obj/sign")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
local m = room:new()
 | 
					local m = room:new()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
sundial:from{
 | 
					sundial:from{
 | 
				
			||||||
    numbers = {3, 5, 8, 2, 7},
 | 
					    numbers = {3, 5, 8, 2, 7},
 | 
				
			||||||
}:install(m, 140, 160)
 | 
					}:install(m, 135, 155)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
local d = door:from{
 | 
					local d = door:from{
 | 
				
			||||||
    destination = 'Vivarium',
 | 
					    destination = 'Vivarium',
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
d:install(m, 80, 60)
 | 
					 | 
				
			||||||
d.mousepressed = d.keypadMode
 | 
					d.mousepressed = d.keypadMode
 | 
				
			||||||
 | 
					d:install(m, 80, 60)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
keypad:from{
 | 
					keypad:from{
 | 
				
			||||||
    code = 35827,
 | 
					    code = 35827,
 | 
				
			||||||
    oncorrect = function (self)
 | 
					    oncorrect = function (self)
 | 
				
			||||||
        d.locked = false
 | 
					        d.locked = false
 | 
				
			||||||
    end,
 | 
					    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")
 | 
					edge.set(m, 'down', "Alley")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		
		Reference in a new issue