Points
Explore how to build a dynamic points system in Tetris with JavaScript by assigning scores for single and multiple line clears, soft drops, and hard drops. Understand using proxies to track score updates and integrate game mechanics to keep players engaged with increasing challenges.
We'll cover the following...
To add a bit more excitement to our game, we need to have some kind of points system. Most games award points to the player for completing various tasks.
Point system
The scoring formula for Tetris is built on the idea that more difficult line clears should be awarded more points. For example, a single line clear in Tetris is worth 100 points, clearing four lines at once (known as a Tetris) is worth 800.
Tetris games also allow the player to press a button to increase the speed of the current piece’s descent or cause the piece to drop and lock into place immediately. These are known as a “soft drop” and a “hard drop,” respectively.
We can award some points based on the height that the piece fell before locking, and which drop was used.
With these guidelines, we set these values as our points system:
const POINTS = { ...