Skip to content

Instantly share code, notes, and snippets.

@melcor76

melcor76/main.js Secret

Created November 19, 2019 13:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save melcor76/3afc7ceebb82b8fe79b61022c8f3a163 to your computer and use it in GitHub Desktop.
Save melcor76/3afc7ceebb82b8fe79b61022c8f3a163 to your computer and use it in GitHub Desktop.
js-tetris - drop points
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