Major sound effect update (closes #7?)

Sound effects can still be changed, and #7 can still be reopened.
pull/13/head
Ishaan Bhardwaj 2020-12-05 20:30:59 -05:00
parent 1f686fb5d4
commit 4afe9f2bd4
11 changed files with 19 additions and 9 deletions

View File

@ -38,8 +38,9 @@ Sounds
------
All piece sounds are (c) 2020 Damian Yerrick.
Ready / go sounds from NullpoMino.
Menu sounds from TGM3 (will be replaced.)
Other sounds from:
- NullpoMino
- DTET, (c) 2003 Mihys.
Music
-----

View File

@ -20,6 +20,8 @@ sounds = {
fall = love.audio.newSource("res/se/fall.wav", "static"),
ready = love.audio.newSource("res/se/ready.wav", "static"),
go = love.audio.newSource("res/se/go.wav", "static"),
irs = love.audio.newSource("res/se/irs.wav", "static"),
ihs = love.audio.newSource("res/se/ihs.wav", "static"),
}
function playSE(sound, subsound)

Binary file not shown.

Binary file not shown.

BIN
res/se/ihs.wav Normal file

Binary file not shown.

BIN
res/se/irs.wav Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -224,9 +224,7 @@ end
function GameMode:onLineClear(cleared_row_count) end
function GameMode:onPieceEnter() end
function GameMode:onHold()
playSE("hold")
end
function GameMode:onHold() end
function GameMode:onSoftDrop(dropped_row_count)
self.drop_bonus = self.drop_bonus + 1 * dropped_row_count
@ -363,7 +361,7 @@ end
function GameMode:initializeOrHold(inputs, ruleset)
if self.ihs and self.enable_hold and inputs["hold"] == true then
self:hold(inputs, ruleset)
self:hold(inputs, ruleset, true)
else
self:initializeNextPiece(inputs, ruleset, self.next_queue[1])
end
@ -374,7 +372,7 @@ function GameMode:initializeOrHold(inputs, ruleset)
end
end
function GameMode:hold(inputs, ruleset)
function GameMode:hold(inputs, ruleset, ihs)
local data = copy(self.hold_queue)
if self.piece == nil then
self.hold_queue = self.next_queue[1]
@ -393,6 +391,8 @@ function GameMode:hold(inputs, ruleset)
self:initializeNextPiece(inputs, ruleset, data, false)
end
self.held = true
if ihs then playSE("ihs")
else playSE("hold") end
self:onHold()
end

View File

@ -291,7 +291,7 @@ function PhantomMania2Game:setHoldOpacity()
if self.level > 1000 and self.level < 1300 then
love.graphics.setColor(1, 1, 1, 1 - math.min(1, self.hold_age / 15))
else
love.graphics.setColor(1, 1, 1, 1)
self.super:setHoldOpacity(1, self.held and 0.6 or 1)
end
end

View File

@ -197,7 +197,14 @@ function Ruleset:initializePiece(
}, self.block_offsets, 0, 0, data.skin, colours[data.shape], big)
self:onPieceCreate(piece)
if irs then self:rotatePiece(inputs, piece, grid, {}, true) end
if irs then
if inputs.rotate_left or inputs.rotate_left2 or
inputs.rotate_right or inputs.rotate_right2 or
inputs.rotate_180 then
playSE("irs")
end
self:rotatePiece(inputs, piece, grid, {}, true)
end
self:dropPiece(inputs, piece, grid, gravity, drop_speed, drop_locked, hard_drop_locked)
return piece
end