From a5c9e687ee604a5c783c7873ffa0d5a5e5f6813c Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Sun, 21 Sep 2025 11:11:47 +0200 Subject: [PATCH] feat: add sound on shape locked and row clear --- main.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index bc99433..881c145 100644 --- a/main.go +++ b/main.go @@ -43,6 +43,8 @@ func SpawnShape() { } func LockShape() { + audio.Play(assets.SFX_SHAPE_LOCKED) + for _, block := range shape.Coordinates() { block = shape_pos.Add(block) // Check bounds @@ -86,7 +88,11 @@ func Update(delta float32) { // Update position if it does not collide if game.CheckShapeCollision(new_pos, &shape, &grid) { LockShape() - score.Lines(grid.ClearFullRows()) + num_rows := grid.ClearFullRows() + if num_rows > 0 { + audio.Play(assets.SFX_ROW_CLEARED) + score.Lines(num_rows) + } SpawnShape() } else { shape_pos = new_pos