v0.3-beta5

This commit is contained in:
Ishaan Bhardwaj 2021-02-18 15:09:43 -05:00
parent 209ff25342
commit 51874b435a
3 changed files with 40 additions and 4 deletions

View File

@ -0,0 +1,39 @@
local SurvivalA2Game = require "tetris.modes.survival_a2n"
local InversionGame = SurvivalA2Game:extend()
InversionGame.name = "Inversion A2N"
InversionGame.hash = "InversionA2N"
InversionGame.tagline = "What if the active piece was invisible?"
function InversionGame:new()
SurvivalA2Game:new()
self.piece_active_time = 0
end
function InversionGame:onPieceEnter()
if (self.level % 100 ~= 99 and self.level ~= 998) and not self.clear and self.frames ~= 0 then
self.level = self.level + 1
end
self.piece_active_time = 0
end
function InversionGame:onHold()
self.piece_active_time = 0
end
function InversionGame:whilePieceActive()
self.piece_active_time = self.piece_active_time + 1
end
function InversionGame:getPieceFadeoutTime()
return math.ceil(self:getLockDelay() / 4)
end
function InversionGame:drawPiece()
if self.piece ~= nil then
self.piece:draw(1 - self.piece_active_time / self:getPieceFadeoutTime(), 1, grid)
end
end
return InversionGame

View File

@ -41,10 +41,6 @@ RandomPieces.big_spawn_positions = {
{ x=2, y=3 } { x=2, y=3 }
} }
RandomPieces.draw_offsets = {
{ x=0, y=0 }
}
RandomPieces.next_sounds = { RandomPieces.next_sounds = {
"O" "O"
} }

View File

@ -100,6 +100,7 @@ function Tetra:onPieceCreate(piece) piece.lowest_y = -math.huge end
function Tetra:onPieceDrop(piece) self:checkNewLow(piece) end function Tetra:onPieceDrop(piece) self:checkNewLow(piece) end
function Tetra:onPieceMove() end function Tetra:onPieceMove() end
function Tetra:onPieceRotate() end function Tetra:onPieceRotate() end
function Tetra:canPieceRotate() return true end
function Tetra:get180RotationValue() return 2 end function Tetra:get180RotationValue() return 2 end
return Tetra return Tetra