Change default room drawing
This commit is contained in:
		
							parent
							
								
									82c0976e3c
								
							
						
					
					
						commit
						a96f8e1aa3
					
				
					 1 changed files with 8 additions and 2 deletions
				
			
		
							
								
								
									
										10
									
								
								room.lua
									
										
									
									
									
								
							
							
						
						
									
										10
									
								
								room.lua
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -7,7 +7,13 @@ local entity = require('entity')
 | 
			
		|||
-- - objects
 | 
			
		||||
-- - edges
 | 
			
		||||
local room = entity:from{
 | 
			
		||||
    background = love.graphics.newImage("res/defaultbg.png"),
 | 
			
		||||
    lines = {
 | 
			
		||||
        {'line', 0, 0, 120, 80},
 | 
			
		||||
        {'line', 320, 0, 200, 80},
 | 
			
		||||
        {'line', 0, 240, 120, 160},
 | 
			
		||||
        {'line', 320, 240, 200, 160},
 | 
			
		||||
        {'fill', 120, 80, 200, 80, 200, 160, 200, 80},
 | 
			
		||||
    },
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
local from = room.from
 | 
			
		||||
| 
						 | 
				
			
			@ -31,7 +37,7 @@ end
 | 
			
		|||
room.mousepressed = window.propagate{'edges', 'objects'}
 | 
			
		||||
 | 
			
		||||
function room:draw()
 | 
			
		||||
    love.graphics.draw(self.background, 0, 0)
 | 
			
		||||
    self:draw_lines(self.lines)
 | 
			
		||||
 | 
			
		||||
    for i, v in ipairs(self.objects) do
 | 
			
		||||
        v:draw()
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue