Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created Nov 2, 2020
Embed
What would you like to do?
// Square length in pixels
static SQUARE_LENGTH = screen.width > 420 ? 30 : 20;
static COLUMNS = 10;
static ROWS = 20;
static CANVAS_WIDTH = this.SQUARE_LENGTH * this.COLUMNS;
static CANVAS_HEIGHT = this.SQUARE_LENGTH * this.ROWS;
static EMPTY_COLOR = "#eaeaea";
static BORDER_COLOR = "#ffffff";
static DELETED_ROW_COLOR = "#d81c38";
// When a piece collapses with something at its bottom, how many time wait for putting another piece? (in ms)
static TIMEOUT_LOCK_PUT_NEXT_PIECE = 300;
// Speed of falling piece (in ms)
static PIECE_SPEED = 300;
// Animation time when a row is being deleted
static DELETE_ROW_ANIMATION = 500;
// Score to add when a square dissapears (for each square)
static PER_SQUARE_SCORE = 1;
static COLORS = [
"#ffd300",
"#de38c8",
"#652ec7",
"#33135c",
"#13ca91",
"#ff9472",
"#35212a",
"#ff8b8b",
"#28cf75",
"#00a9fe",
"#04005e",
"#120052",
"#272822",
"#f92672",
"#66d9ef",
"#a6e22e",
"#fd971f",
];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment