mirror of
https://github.com/SashLilac/cambridge-modpack.git
synced 2024-12-24 22:59:02 -06:00
C88 cleanup
This commit is contained in:
parent
d6707cbf48
commit
ac7fad1003
@ -38,23 +38,14 @@ function MarathonC88Game:new(secret_inputs)
|
||||
|
||||
self.irs = false
|
||||
|
||||
self.grid.getCell = function(_, x, y)
|
||||
if x < 1 or x > 10 or y < 5 or y > 24 then return oob
|
||||
self.grid.getCell = function(self, x, y)
|
||||
if x < 1 or x > self.width or y < 5 or y > self.height then return oob
|
||||
elseif y < 1 then return empty
|
||||
else return self.grid[y][x]
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function MarathonC88Game:initialize(ruleset)
|
||||
self.super:initialize(ruleset)
|
||||
for _, p in pairs(ruleset.spawn_positions) do
|
||||
while p.y < 4 do
|
||||
p.y = p.y + 2
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function MarathonC88Game:getARE() return 30 end
|
||||
function MarathonC88Game:getLineARE() return 30 end
|
||||
function MarathonC88Game:getDasLimit() return 20 end
|
||||
@ -98,6 +89,22 @@ function MarathonC88Game:getScoreMultiplier()
|
||||
else return 5 end
|
||||
end
|
||||
|
||||
function MarathonC88Game:onPieceEnter()
|
||||
function checkOOB()
|
||||
local offsets = self.piece:getBlockOffsets()
|
||||
for _, offset in pairs(offsets) do
|
||||
if self.piece.position.y + offset.y < 4 then
|
||||
return true
|
||||
end
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
while checkOOB() do
|
||||
self.piece.position.y = self.piece.position.y + 1
|
||||
end
|
||||
end
|
||||
|
||||
function MarathonC88Game:advanceOneFrame()
|
||||
if not (self.piece == nil and self.level_timer == 0) and self.ready_frames == 0 then
|
||||
self.level_timer = self.level_timer + 1
|
||||
|
Loading…
Reference in New Issue
Block a user