mirror of
https://github.com/SashLilac/cambridge-modpack.git
synced 2024-11-22 14:09:02 -06:00
v0.3-beta5
This commit is contained in:
parent
209ff25342
commit
51874b435a
39
tetris/modes/inversion_a2n.lua
Normal file
39
tetris/modes/inversion_a2n.lua
Normal 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
|
@ -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"
|
||||||
}
|
}
|
||||||
|
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user