summaryrefslogtreecommitdiff
path: root/game/init.lua
diff options
context:
space:
mode:
Diffstat (limited to 'game/init.lua')
-rw-r--r--game/init.lua12
1 files changed, 12 insertions, 0 deletions
diff --git a/game/init.lua b/game/init.lua
index 386a7c4..085b0e8 100644
--- a/game/init.lua
+++ b/game/init.lua
@@ -60,8 +60,10 @@ function M:input_loop()
while self.piece:move(-1, 0) do end
elseif key == "up" then
moved = self.piece:rotate()
+ if moved then self:on_rotated() end
elseif key == "lctrl" then
moved = self.piece:rotate(true)
+ if moved then self:on_rotated() end
elseif key == "space" then
local dropped = false
while self.piece:move(-1, 0) do
@@ -98,6 +100,16 @@ function M:input_loop()
return loop
end
+function M:on_rotated()
+ if self.piece.t_spun then
+ if self.piece.last_kick_id == 5 then
+ sfx.play("tspinkick5")
+ else
+ sfx.play("tspin")
+ end
+ end
+end
+
function M:place_piece()
if not self.piece:can_move(-1, 0) then
self.piece:place()