Replace SFX and add hold
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
local Object = require 'libs.classic'
|
||||
require 'funcs'
|
||||
|
||||
local playedReadySE = false
|
||||
local playedGoSE = false
|
||||
|
||||
local Grid = require 'tetris.components.grid'
|
||||
local Randomizer = require 'tetris.randomizers.randomizer'
|
||||
|
||||
@@ -202,7 +205,9 @@ end
|
||||
function GameMode:onLineClear(cleared_row_count) end
|
||||
|
||||
function GameMode:onPieceEnter() end
|
||||
function GameMode:onHold() end
|
||||
function GameMode:onHold()
|
||||
playSE("hold")
|
||||
end
|
||||
|
||||
function GameMode:onSoftDrop(dropped_row_count)
|
||||
self.drop_bonus = self.drop_bonus + 1 * dropped_row_count
|
||||
@@ -244,8 +249,20 @@ function GameMode:chargeDAS(inputs)
|
||||
end
|
||||
|
||||
function GameMode:processDelays(inputs, ruleset, drop_speed)
|
||||
if self.ready_frames == 100 then
|
||||
playedReadySE = false
|
||||
playedGoSE = false
|
||||
end
|
||||
if self.ready_frames > 0 then
|
||||
if not playedReadySE then
|
||||
playedReadySE = true
|
||||
playSEOnce("ready")
|
||||
end
|
||||
self.ready_frames = self.ready_frames - 1
|
||||
if self.ready_frames == 50 and not playedGoSE then
|
||||
playedGoSE = true
|
||||
playSEOnce("go")
|
||||
end
|
||||
if self.ready_frames == 0 then
|
||||
self:initializeOrHold(inputs, ruleset)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user