From 91a87fea73053e5a5473e56cab96fecdb6953fc8 Mon Sep 17 00:00:00 2001 From: Joe Zeng Date: Sat, 7 Nov 2020 01:12:13 -0500 Subject: [PATCH 1/2] Fixed the garbage pausing problem in Phantom Mania 2. --- load/graphics.lua | 4 +++ tetris/components/grid.lua | 7 +++--- tetris/modes/survival_a3.lua | 1 + tetris/modes/tgmplus.lua | 49 ++++++++++++++++++------------------ 4 files changed, 34 insertions(+), 27 deletions(-) diff --git a/load/graphics.lua b/load/graphics.lua index 4269aa6..c878774 100644 --- a/load/graphics.lua +++ b/load/graphics.lua @@ -33,6 +33,8 @@ blocks = { C = love.graphics.newImage("res/img/s2.png"), B = love.graphics.newImage("res/img/s4.png"), M = love.graphics.newImage("res/img/s5.png"), + F = love.graphics.newImage("res/img/s9.png"), + A = love.graphics.newImage("res/img/s9.png"), X = love.graphics.newImage("res/img/s9.png"), }, ["bone"] = { @@ -43,6 +45,8 @@ blocks = { C = love.graphics.newImage("res/img/bone.png"), B = love.graphics.newImage("res/img/bone.png"), M = love.graphics.newImage("res/img/bone.png"), + F = love.graphics.newImage("res/img/bone.png"), + A = love.graphics.newImage("res/img/bone.png"), X = love.graphics.newImage("res/img/bone.png"), } } diff --git a/tetris/components/grid.lua b/tetris/components/grid.lua index 1cfcfcb..a1d10d6 100644 --- a/tetris/components/grid.lua +++ b/tetris/components/grid.lua @@ -4,7 +4,7 @@ local Grid = Object:extend() local empty = { skin = "", colour = "" } local oob = { skin = "", colour = "" } -local block = { skin = "2tie", colour = "X" } +local block = { skin = "2tie", colour = "A" } function Grid:new() self.grid = {} @@ -170,6 +170,7 @@ function Grid:applyFourWide() x[10] = x[10]~=block and block or x[10] end end + function Grid:applyPiece(piece) if piece.big then self:applyBigPiece(piece) @@ -263,7 +264,7 @@ function Grid:draw() for y = 5, 24 do for x = 1, 10 do if self.grid[y][x] ~= empty then - if self.grid_age[y][x] < 1 then + if self.grid_age[y][x] < 2 then love.graphics.setColor(1, 1, 1, 1) love.graphics.draw(blocks[self.grid[y][x].skin]["F"], 48+x*16, y*16) else @@ -297,7 +298,7 @@ function Grid:drawInvisible(opacity_function, garbage_opacity_function) if self.grid[y][x] ~= empty then if self.grid[y][x].colour == "X" then opacity = 1 - elseif garbage_opacity_function and self.grid[y][x].colour == "G" then + elseif garbage_opacity_function and self.grid[y][x].colour == "A" then opacity = garbage_opacity_function(self.grid_age[y][x]) else opacity = opacity_function(self.grid_age[y][x]) diff --git a/tetris/modes/survival_a3.lua b/tetris/modes/survival_a3.lua index 5dc799c..ad6b674 100644 --- a/tetris/modes/survival_a3.lua +++ b/tetris/modes/survival_a3.lua @@ -16,6 +16,7 @@ SurvivalA3Game.tagline = "The blocks turn black and white! Can you make it to le function SurvivalA3Game:new() SurvivalA3Game.super:new() + self.level = 0 self.grade = 0 self.garbage = 0 self.clear = false diff --git a/tetris/modes/tgmplus.lua b/tetris/modes/tgmplus.lua index 1b76e65..58840e0 100644 --- a/tetris/modes/tgmplus.lua +++ b/tetris/modes/tgmplus.lua @@ -32,30 +32,31 @@ function TGMPlusGame:new() self.garbage_queue = 0 self.garbage_pos = 0 self.garbage_rows = { - [0] = {"e", "b", "b", "b", "b", "b", "b", "b", "b", "b"}, - {"e", "b", "b", "b", "b", "b", "b", "b", "b", "b"}, - {"e", "b", "b", "b", "b", "b", "b", "b", "b", "b"}, - {"e", "b", "b", "b", "b", "b", "b", "b", "b", "b"}, - {"b", "b", "b", "b", "b", "b", "b", "b", "b", "e"}, - {"b", "b", "b", "b", "b", "b", "b", "b", "b", "e"}, - {"b", "b", "b", "b", "b", "b", "b", "b", "b", "e"}, - {"b", "b", "b", "b", "b", "b", "b", "b", "b", "e"}, - {"e", "e", "b", "b", "b", "b", "b", "b", "b", "b"}, - {"e", "b", "b", "b", "b", "b", "b", "b", "b", "b"}, - {"e", "b", "b", "b", "b", "b", "b", "b", "b", "b"}, - {"b", "b", "b", "b", "b", "b", "b", "b", "e", "e"}, - {"b", "b", "b", "b", "b", "b", "b", "b", "b", "e"}, - {"b", "b", "b", "b", "b", "b", "b", "b", "b", "e"}, - {"b", "b", "e", "b", "b", "b", "b", "b", "b", "b"}, - {"b", "e", "e", "b", "b", "b", "b", "b", "b", "b"}, - {"b", "e", "b", "b", "b", "b", "b", "b", "b", "b"}, - {"b", "b", "b", "b", "b", "b", "b", "e", "b", "b"}, - {"b", "b", "b", "b", "b", "b", "b", "e", "e", "b"}, - {"b", "b", "b", "b", "b", "b", "b", "b", "e", "b"}, - {"b", "b", "b", "b", "e", "e", "b", "b", "b", "b"}, - {"b", "b", "b", "b", "e", "e", "b", "b", "b", "b"}, - {"b", "b", "b", "b", "e", "b", "b", "b", "b", "b"}, - {"b", "b", "b", "e", "e", "e", "b", "b", "b", "b"}, + [0] = + {"e", "b", "b", "b", "b", "b", "b", "b", "b", "b"}, + {"e", "b", "b", "b", "b", "b", "b", "b", "b", "b"}, + {"e", "b", "b", "b", "b", "b", "b", "b", "b", "b"}, + {"e", "b", "b", "b", "b", "b", "b", "b", "b", "b"}, + {"b", "b", "b", "b", "b", "b", "b", "b", "b", "e"}, + {"b", "b", "b", "b", "b", "b", "b", "b", "b", "e"}, + {"b", "b", "b", "b", "b", "b", "b", "b", "b", "e"}, + {"b", "b", "b", "b", "b", "b", "b", "b", "b", "e"}, + {"e", "e", "b", "b", "b", "b", "b", "b", "b", "b"}, + {"e", "b", "b", "b", "b", "b", "b", "b", "b", "b"}, + {"e", "b", "b", "b", "b", "b", "b", "b", "b", "b"}, + {"b", "b", "b", "b", "b", "b", "b", "b", "e", "e"}, + {"b", "b", "b", "b", "b", "b", "b", "b", "b", "e"}, + {"b", "b", "b", "b", "b", "b", "b", "b", "b", "e"}, + {"b", "b", "e", "b", "b", "b", "b", "b", "b", "b"}, + {"b", "e", "e", "b", "b", "b", "b", "b", "b", "b"}, + {"b", "e", "b", "b", "b", "b", "b", "b", "b", "b"}, + {"b", "b", "b", "b", "b", "b", "b", "e", "b", "b"}, + {"b", "b", "b", "b", "b", "b", "b", "e", "e", "b"}, + {"b", "b", "b", "b", "b", "b", "b", "b", "e", "b"}, + {"b", "b", "b", "b", "e", "e", "b", "b", "b", "b"}, + {"b", "b", "b", "b", "e", "e", "b", "b", "b", "b"}, + {"b", "b", "b", "b", "e", "b", "b", "b", "b", "b"}, + {"b", "b", "b", "e", "e", "e", "b", "b", "b", "b"}, } end From 1b381c4bf3d0a538f536c6c7bb2a855bd55ecc60 Mon Sep 17 00:00:00 2001 From: Joe Zeng Date: Sat, 7 Nov 2020 01:29:44 -0500 Subject: [PATCH 2/2] Might as well add the dark square while I'm at it. --- load/graphics.lua | 2 +- res/img/s8.png | Bin 0 -> 233 bytes tetris/modes/survival_a3.lua | 3 --- 3 files changed, 1 insertion(+), 4 deletions(-) create mode 100644 res/img/s8.png diff --git a/load/graphics.lua b/load/graphics.lua index c878774..a0525b0 100644 --- a/load/graphics.lua +++ b/load/graphics.lua @@ -34,7 +34,7 @@ blocks = { B = love.graphics.newImage("res/img/s4.png"), M = love.graphics.newImage("res/img/s5.png"), F = love.graphics.newImage("res/img/s9.png"), - A = love.graphics.newImage("res/img/s9.png"), + A = love.graphics.newImage("res/img/s8.png"), X = love.graphics.newImage("res/img/s9.png"), }, ["bone"] = { diff --git a/res/img/s8.png b/res/img/s8.png new file mode 100644 index 0000000000000000000000000000000000000000..3e063f8f9c8181b460fba526f48bd25f497bc97e GIT binary patch literal 233 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbL!Wq?nJYh6`IMP+eGaX~?Tj*5y( zPIhKyMw*O_OiD^pLPA`0R76N{ke{Eghr3&NSeTQegN==~g_)U&vC+Ddtb9O2I14-? ziy0XB4ude`@%$AjK*2Ci7sn8Z@YGZ8d<_Ny&KG?+GX+ll