mirror of
https://github.com/SashLilac/cambridge.git
synced 2024-11-22 19:09:02 -06:00
Cleaned up TAP M-roll
This commit is contained in:
parent
b9b71e90bb
commit
721acefea0
@ -310,7 +310,9 @@ function Grid:draw()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function Grid:drawInvisible(opacity_function, garbage_opacity_function)
|
function Grid:drawInvisible(opacity_function, garbage_opacity_function, lock_flash, brightness)
|
||||||
|
lock_flash = lock_flash == nil and true or lock_flash
|
||||||
|
brightness = brightness == nil and 0.5 or brightness
|
||||||
for y = 5, 24 do
|
for y = 5, 24 do
|
||||||
for x = 1, 10 do
|
for x = 1, 10 do
|
||||||
if self.grid[y][x] ~= empty then
|
if self.grid[y][x] ~= empty then
|
||||||
@ -321,8 +323,9 @@ function Grid:drawInvisible(opacity_function, garbage_opacity_function)
|
|||||||
else
|
else
|
||||||
opacity = opacity_function(self.grid_age[y][x])
|
opacity = opacity_function(self.grid_age[y][x])
|
||||||
end
|
end
|
||||||
love.graphics.setColor(0.5, 0.5, 0.5, opacity)
|
love.graphics.setColor(brightness, brightness, brightness, opacity)
|
||||||
love.graphics.draw(blocks[self.grid[y][x].skin][self.grid[y][x].colour], 48+x*16, y*16)
|
love.graphics.draw(blocks[self.grid[y][x].skin][self.grid[y][x].colour], 48+x*16, y*16)
|
||||||
|
if lock_flash then
|
||||||
if opacity > 0 and self.grid[y][x].colour ~= "X" then
|
if opacity > 0 and self.grid[y][x].colour ~= "X" then
|
||||||
love.graphics.setColor(0.64, 0.64, 0.64)
|
love.graphics.setColor(0.64, 0.64, 0.64)
|
||||||
love.graphics.setLineWidth(1)
|
love.graphics.setLineWidth(1)
|
||||||
@ -342,6 +345,7 @@ function Grid:drawInvisible(opacity_function, garbage_opacity_function)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
return Grid
|
return Grid
|
||||||
|
@ -250,7 +250,7 @@ end
|
|||||||
|
|
||||||
function MarathonA2Game:drawGrid(ruleset)
|
function MarathonA2Game:drawGrid(ruleset)
|
||||||
if self.clear and not (self.completed or self.game_over) then
|
if self.clear and not (self.completed or self.game_over) then
|
||||||
self.grid:drawInvisible(self.rollOpacityFunction)
|
self.grid:drawInvisible(self.rollOpacityFunction, nil, false)
|
||||||
else
|
else
|
||||||
self.grid:draw()
|
self.grid:draw()
|
||||||
if self.piece ~= nil and self.level < 100 then
|
if self.piece ~= nil and self.level < 100 then
|
||||||
|
@ -305,10 +305,17 @@ MarathonA2Game.rollOpacityFunction = function(age)
|
|||||||
else return 1 - (age - 240) / 60 end
|
else return 1 - (age - 240) / 60 end
|
||||||
end
|
end
|
||||||
|
|
||||||
function MarathonA2Game:drawGrid(ruleset)
|
MarathonA2Game.mRollOpacityFunction = function(age)
|
||||||
|
if age > 4 then return 0
|
||||||
|
else return 1 - age / 4 end
|
||||||
|
end
|
||||||
|
|
||||||
|
function MarathonA2Game:drawGrid()
|
||||||
if self.clear and not (self.completed or self.game_over) then
|
if self.clear and not (self.completed or self.game_over) then
|
||||||
if not self:qualifiesForMRoll() then
|
if self:qualifiesForMRoll() then
|
||||||
self.grid:drawInvisible(self.rollOpacityFunction)
|
self.grid:drawInvisible(self.mRollOpacityFunction, nil, false)
|
||||||
|
else
|
||||||
|
self.grid:drawInvisible(self.rollOpacityFunction, nil, false)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
self.grid:draw()
|
self.grid:draw()
|
||||||
|
@ -231,8 +231,8 @@ function MarathonA3Game:updateSectionTimes(old_level, new_level)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function MarathonA3Game:updateScore(level, drop_bonus, cleared_lines)
|
function MarathonA3Game:updateScore(level, drop_bonus, cleared_lines)
|
||||||
if not self.clear then
|
|
||||||
self:updateGrade(cleared_lines)
|
self:updateGrade(cleared_lines)
|
||||||
|
if not self.clear then
|
||||||
if cleared_lines > 0 then
|
if cleared_lines > 0 then
|
||||||
self.combo = self.combo + (cleared_lines - 1) * 2
|
self.combo = self.combo + (cleared_lines - 1) * 2
|
||||||
self.score = self.score + (
|
self.score = self.score + (
|
||||||
|
@ -139,7 +139,7 @@ end
|
|||||||
|
|
||||||
function PhantomManiaGame:drawGrid()
|
function PhantomManiaGame:drawGrid()
|
||||||
if not (self.game_over or self.clear) then
|
if not (self.game_over or self.clear) then
|
||||||
self.grid:drawInvisible(self.rollOpacityFunction)
|
self.grid:drawInvisible(self.rollOpacityFunction, nil, false)
|
||||||
else
|
else
|
||||||
self.grid:draw()
|
self.grid:draw()
|
||||||
end
|
end
|
||||||
|
22
tetris/modes/phantom_mania_n.lua
Normal file
22
tetris/modes/phantom_mania_n.lua
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
local PhantomManiaGame = require 'tetris.modes.phantom_mania'
|
||||||
|
|
||||||
|
local PhantomManiaNGame = PhantomManiaGame:extend()
|
||||||
|
|
||||||
|
PhantomManiaNGame.name = "Phantom Mania N"
|
||||||
|
PhantomManiaNGame.hash = "PhantomManiaN"
|
||||||
|
PhantomManiaNGame.tagline = "The old mode from Nullpomino, for Ti-ARS and SRS support."
|
||||||
|
|
||||||
|
function PhantomManiaNGame:new()
|
||||||
|
PhantomManiaNGame.super:new()
|
||||||
|
|
||||||
|
self.SGnames = {
|
||||||
|
"M1", "M2", "M3", "M4", "M5", "M6", "M7", "M8", "M9",
|
||||||
|
"M10", "M11", "M12", "M13", "M14", "M15", "M16", "M17", "M18",
|
||||||
|
"GM"
|
||||||
|
}
|
||||||
|
|
||||||
|
self.next_queue_length = 3
|
||||||
|
self.enable_hold = true
|
||||||
|
end
|
||||||
|
|
||||||
|
return PhantomManiaNGame
|
Loading…
Reference in New Issue
Block a user