Fixed the garbage pausing problem in Phantom Mania 2.

This commit is contained in:
Joe Zeng 2020-11-07 01:31:09 -05:00 committed by GitHub
commit a105086ca6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 33 additions and 29 deletions

View File

@ -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/s8.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"),
}
}

BIN
res/img/s8.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 233 B

View File

@ -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])

View File

@ -12,8 +12,6 @@ SurvivalA3Game.hash = "SurvivalA3"
SurvivalA3Game.tagline = "The blocks turn black and white! Can you make it to level 1300?"
function SurvivalA3Game:new()
SurvivalA3Game.super:new()
self.grade = 0

View File

@ -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