Small change
This commit is contained in:
		
							parent
							
								
									e89fa5f15c
								
							
						
					
					
						commit
						d7855c69c2
					
				
					 2 changed files with 8 additions and 5 deletions
				
			
		| 
						 | 
				
			
			@ -65,6 +65,7 @@ m.mousepressed = window.mousepressed(function (self, x, y, button)
 | 
			
		|||
end)
 | 
			
		||||
 | 
			
		||||
function m:install(room, x, y)
 | 
			
		||||
    self.room = room
 | 
			
		||||
    self:setpos(x, y)
 | 
			
		||||
    room:insert(self)
 | 
			
		||||
end
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										12
									
								
								item.lua
									
										
									
									
									
								
							
							
						
						
									
										12
									
								
								item.lua
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -30,12 +30,14 @@ function m:itemMode()
 | 
			
		|||
    end)
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
local install = m.install
 | 
			
		||||
function m:install(room, x, y)
 | 
			
		||||
    local i = self:new()
 | 
			
		||||
    i.room = room
 | 
			
		||||
    i:pickupMode()
 | 
			
		||||
    i:setpos(x, y)
 | 
			
		||||
    room:insert(i)
 | 
			
		||||
    self:pickupMode()
 | 
			
		||||
    install(self, room, x, y)
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
function m:spawn(room, x, y)
 | 
			
		||||
    self:new():install(room, x, y)
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
return m
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue