-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconstants.py
45 lines (45 loc) · 891 Bytes
/
constants.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
"""
This module contains the constants used in the game.
"""
# GRAPHICS CONSTANTS
WINDOW_SIZE = (600, 600)
CELL_SIZE = 100
BOARD_X_MARGIN = 84
BOARD_Y_MARGIN = 125
CELL_PADDING = 8
# SCORE LABELS
Y_SCORE_POSITION = (50, 105)
TEXT_PADDING = 15
# NEW GAME BUTTON
NEW_GAME_BUTTON = (402.5, 65, 512.5, 105)
NEW_GAME_BUTTON_COLOR = "#8f7a66"
# GAME CONSTANTS
WIN_NUMBER = 2048
INITIAL_SCORE = 0
POSSIBLE_INITIAL_VALUES = (2, 4)
ROWS = 4
COLUMNS = 4
# DIRECTIONS
UP = "Up"
RIGHT = "Right"
DOWN = "Down"
LEFT = "Left"
EMPTY = 0
# FORMATTING CONSTANTS
BACKGROUND_COLOR = "#fcf8ef"
DEFAULT_CELL_COLOR = "#ccc1b2"
BOARD_BACKGROUND_COLOR = "#bbad9e"
NUMBERS_COLOR = "black"
COLORS = {
2: "#fad2d7",
4: "#e6aef4",
8: "#f59eb1",
16: "#ff6f91",
32: "#f984a1",
64: "#f8818a",
128: "#e6f1f8",
256: "#94c2e5",
512: "#f368e0",
1024: "#81b5e9",
2048: "#073a6e",
}