From 4b4a96863235ff00ef0365c1305339c5250e10bf Mon Sep 17 00:00:00 2001 From: Ishaan Bhardwaj Date: Mon, 8 Mar 2021 12:41:46 -0500 Subject: [PATCH] Fixed a bone block drawing issue --- tetris/components/grid.lua | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/tetris/components/grid.lua b/tetris/components/grid.lua index fa89d23..c7c2721 100644 --- a/tetris/components/grid.lua +++ b/tetris/components/grid.lua @@ -400,11 +400,10 @@ function Grid:draw() love.graphics.setColor(1, 1, 1, 1) love.graphics.draw(blocks[self.grid[y][x].skin]["F"], 48+x*16, y*16) else - if self.grid[y][x].skin == "bone" then - love.graphics.setColor(1, 1, 1, 1) - elseif self.grid[y][x].colour == "X" then + if self.grid[y][x].colour == "X" then love.graphics.setColor(0, 0, 0, 0) - --love.graphics.setColor(0.5, 0.5, 0.5, 1 - self.grid_age[y][x] / 15) + elseif self.grid[y][x].skin == "bone" then + love.graphics.setColor(1, 1, 1, 1) else love.graphics.setColor(0.5, 0.5, 0.5, 1) end @@ -435,12 +434,6 @@ end function Grid:drawOutline() for y = 5, self.height do for x = 1, self.width do - --[[ - if self.grid[y][x].colour == "X" then - love.graphics.setColor(0.5, 0.5, 0.5, 1 - self.grid_age[y][x] / 15) - love.graphics.draw(blocks[self.grid[y][x].skin][self.grid[y][x].colour], 48+x*16, y*16) - end - ]] if self.grid[y][x] ~= empty and self.grid[y][x].colour ~= "X" then love.graphics.setColor(0.8, 0.8, 0.8, 1) love.graphics.setLineWidth(1) @@ -470,7 +463,6 @@ function Grid:drawInvisible(opacity_function, garbage_opacity_function, lock_fla if self.grid[y][x] ~= empty then if self.grid[y][x].colour == "X" then opacity = 0 - --opacity = 1 - self.grid_age[y][x] / 15 elseif garbage_opacity_function and self.grid[y][x].colour == "A" then opacity = garbage_opacity_function(self.grid_age[y][x]) else @@ -518,7 +510,6 @@ function Grid:drawCustom(colour_function, gamestate) local R, G, B, A, outline = colour_function(gamestate, block, x, y, self.grid_age[y][x]) if self.grid[y][x].colour == "X" then A = 0 - --A = 1 - self.grid_age[y][x] / 15 end love.graphics.setColor(R, G, B, A) love.graphics.draw(blocks[self.grid[y][x].skin][self.grid[y][x].colour], 48+x*16, y*16)