Closed chinatsu closed 7 years ago
Ugh, I realize now that our editors don't indent the same way.. I'll fix that when I wake up
If you clear a line, is it not better if only one of the sounds are played and not both? If so, you could move both sounds to sendLine function (it's always invoked when a piece is placed) and place it within the existing: if lines.x==0 blockplaced, else if lines.x==1 lineclear.
I am under the impression that Cultris II (and the majority of implementations of Tetris I've come across) behave like this, where sounds stack on top of each other.
However, I think you raise a point anyway, because if only one sound plays at a time, it would give a little more freedom to the sound design. As such, I moved pieceDrop()
where you requested it, but left lineClear()
as it is. Moving it into if (lines.x == 1)
would make it trigger only when a single line is cleared, after all.
Excellent!
I'm not entirely sure if I've added the function calls to the right functions, but it seems to work as expected during gameplay.