Add background color to surface

This commit is contained in:
jordan4ibanez 2017-07-10 01:28:19 -04:00
parent 60b6f94ff9
commit ac188c417b
2 changed files with 8 additions and 2 deletions

View File

@ -285,6 +285,12 @@ function maplib.draw()
love.graphics.setFont(font)
for xx = -max_chunks,max_chunks do
for yy = -max_chunks,max_chunks do
--draw sky
if chunky-yy > underground then
love.graphics.setColor(65,105,225,255)
love.graphics.rectangle( "fill", player_drawnx+scale+(map_max*scale*xx)-(player.playerx*scale), player_drawny+scale+(map_max*scale*yy)-(player.playery*scale), scale*map_max,scale*map_max )
love.graphics.setColor(255, 255, 255,255)
end
--love.graphics.setColor(255,255,255)
for x = 1,map_max do

View File

@ -131,10 +131,10 @@ function mine(key)
local right = love.mouse.isDown(2)
mx = math.floor(mx+0.5)
my = math.floor(my+0.5)
if mx ~= -1 and my ~= -1 then
if mx ~= -1 and my ~= -1 and mx >= 1 and mx <= map_max and my >= 1 and my <= map_max then
--play sound and remove tile
if left then
--print(mx,my)
print(mx,my)
if loaded_chunks[selected_chunkx][selected_chunky][mx][my]["block"] ~= 1 then
minesound:setPitch(love.math.random(50,100)/100)
minesound:stop()