-
-
Save melcor76/3afc7ceebb82b8fe79b61022c8f3a163 to your computer and use it in GitHub Desktop.
js-tetris - drop points
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (event.keyCode === KEY.SPACE) { | |
while (board.valid(p)) { | |
account.score += POINTS.HARD_DROP; | |
board.piece.move(p); | |
p = moves[KEY.DOWN](board.piece); | |
} | |
} else if (board.valid(p)) { | |
board.piece.move(p); | |
if (event.keyCode === KEY.DOWN) { | |
account.score += POINTS.SOFT_DROP; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment