-
-
Save melcor76/5c61d1576b184a371c36ef1baed4f3cc to your computer and use it in GitHub Desktop.
js-tetris - lines and level
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 (lines > 0) { | |
// Calculate points from cleared lines and level. | |
account.score += this.getLinesClearedPoints(lines, this.level); | |
account.lines += lines; | |
// If we have reached the lines for next level | |
if (account.lines >= LINES_PER_LEVEL) { | |
// Goto next level | |
account.level++; | |
// Remove lines so we start working for the next level | |
account.lines -= LINES_PER_LEVEL; | |
// Increase speed of game. | |
time.level = Level[account.level]; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment