diff --git a/tetris/modes/gamemode.lua b/tetris/modes/gamemode.lua index 5f9b8bd..a7e9950 100644 --- a/tetris/modes/gamemode.lua +++ b/tetris/modes/gamemode.lua @@ -114,26 +114,33 @@ function GameMode:update(inputs, ruleset) self.hard_drop_locked = false end + local piece_y = self.piece.position.y + ruleset:processPiece( inputs, self.piece, self.grid, self:getGravity(), self.prev_inputs, self.move, self:getLockDelay(), self:getDropSpeed(), self.drop_locked, self.hard_drop_locked, self.enable_hard_drop ) + local piece_dy = self.piece.position.y - piece_y + if inputs["up"] == true and self.piece:isDropBlocked(self.grid) and - not self.hard_drop_locked and - self.instant_hard_drop - then - self.piece.locked = true + not self.hard_drop_locked then + self:onHardDrop(piece_dy) + if self.instant_hard_drop then + self.piece.locked = true + end end - if inputs["down"] == true and - self.piece:isDropBlocked(self.grid) and - not self.drop_locked and - self.instant_soft_drop - then - self.piece.locked = true + if inputs["down"] == true then + self:onSoftDrop(piece_dy) + if self.piece:isDropBlocked(self.grid) and + not self.drop_locked and + self.instant_soft_drop + then + self.piece.locked = true + end end if self.piece.locked == true then @@ -189,6 +196,14 @@ function GameMode:onLineClear(cleared_row_count) end function GameMode:onPieceEnter() end function GameMode:onHold() end +function GameMode:onSoftDrop(dropped_row_count) + self.drop_bonus = self.drop_bonus + 1 * dropped_row_count +end + +function GameMode:onHardDrop(dropped_row_count) + self.drop_bonus = self.drop_bonus + 2 * dropped_row_count +end + function GameMode:onGameOver() switchBGM(nil) end @@ -374,7 +389,8 @@ function GameMode:drawScoringInfo() love.graphics.print( self.das.direction .. " " .. self.das.frames .. " " .. - st(self.prev_inputs) + st(self.prev_inputs) .. + self.drop_bonus ) love.graphics.setFont(font_8x11) diff --git a/tetris/modes/marathon_a1.lua b/tetris/modes/marathon_a1.lua index fb4e2ac..dcb5895 100644 --- a/tetris/modes/marathon_a1.lua +++ b/tetris/modes/marathon_a1.lua @@ -12,7 +12,7 @@ MarathonA1Game.hash = "MarathonA1" MarathonA1Game.tagline = "Can you score enough points to reach the title of Grand Master?" MarathonA1Game.arr = 1 -MarathonA1Game.drop_speed = 1 +function MarathonA1Game:getDropSpeed() return 0.2 end function MarathonA1Game:new() MarathonA1Game.super:new() @@ -34,11 +34,11 @@ function MarathonA1Game:new() end function MarathonA1Game:getARE() - return 25 + return 30 end function MarathonA1Game:getLineARE() - return 25 + return 27 end function MarathonA1Game:getDasLimit() @@ -46,7 +46,7 @@ function MarathonA1Game:getDasLimit() end function MarathonA1Game:getLineClearDelay() - return 40 + return 44 end function MarathonA1Game:getLockDelay() diff --git a/tetris/modes/marathon_a2.lua b/tetris/modes/marathon_a2.lua index e8f0c34..886fbca 100644 --- a/tetris/modes/marathon_a2.lua +++ b/tetris/modes/marathon_a2.lua @@ -35,16 +35,16 @@ function MarathonA2Game:new() end function MarathonA2Game:getARE() - if self.level < 700 then return 25 - elseif self.level < 800 then return 16 - else return 12 end + if self.level < 700 then return 28 + elseif self.level < 800 then return 19 + else return 15 end end function MarathonA2Game:getLineARE() - if self.level < 600 then return 25 - elseif self.level < 700 then return 16 - elseif self.level < 800 then return 12 - else return 6 end + if self.level < 600 then return 27 + elseif self.level < 700 then return 18 + elseif self.level < 800 then return 14 + else return 8 end end function MarathonA2Game:getDasLimit() @@ -54,11 +54,11 @@ function MarathonA2Game:getDasLimit() end function MarathonA2Game:getLineClearDelay() - if self.level < 500 then return 40 - elseif self.level < 600 then return 25 - elseif self.level < 700 then return 16 - elseif self.level < 800 then return 12 - else return 6 end + if self.level < 500 then return 41 + elseif self.level < 600 then return 26 + elseif self.level < 700 then return 17 + elseif self.level < 800 then return 13 + else return 7 end end function MarathonA2Game:getLockDelay() diff --git a/tetris/modes/survival_a1.lua b/tetris/modes/survival_a1.lua index 93fde67..3792086 100644 --- a/tetris/modes/survival_a1.lua +++ b/tetris/modes/survival_a1.lua @@ -33,23 +33,23 @@ function SurvivalA1Game:new() self.next_queue_length = 1 end -function SurvivalA1Game:getARE() - return 25 +function MarathonA1Game:getARE() + return 30 end -function SurvivalA1Game:getLineARE() - return 25 +function MarathonA1Game:getLineARE() + return 27 end -function SurvivalA1Game:getDasLimit() +function MarathonA1Game:getDasLimit() return 15 end -function SurvivalA1Game:getLineClearDelay() - return 40 +function MarathonA1Game:getLineClearDelay() + return 44 end -function SurvivalA1Game:getLockDelay() +function MarathonA1Game:getLockDelay() return 30 end