-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsetting.py
More file actions
65 lines (40 loc) · 1.3 KB
/
setting.py
File metadata and controls
65 lines (40 loc) · 1.3 KB
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
import argparse
def get_screen_width():
from obj import screen
return screen.get_width()
def get_screen_height():
from obj import screen
return screen.get_height()
def get_card_width():
from obj import screen
return min(MAX_CARD_WIDTH, get_screen_width() / 7)
def get_card_height():
return min(MAX_CARD_HEIGHT, get_screen_height() / 3)
def cards_to_draw(value):
ivalue = int(value)
if ivalue > 24:
raise argparse.ArgumentTypeError(f"too many cards {value}")
return ivalue
parser = argparse.ArgumentParser()
parser.add_argument(
"-d", "--debug", type=bool, default=False, help="enables debug output"
)
parser.add_argument(
"-c",
"--cardstodraw",
type=cards_to_draw,
default=3,
help="number of cards to draw at a time (must be less then 24)",
)
DEBUG = parser.parse_args().debug
CARDS_TO_DRAW = parser.parse_args().cardstodraw
FPS = 60
BG_COLOR = (33, 148, 0)
MAX_CARD_WIDTH = 169
MAX_CARD_HEIGHT = 262
MAX_DRAWNCARD_X_OFFSET = 40
# the playing column automatically solves for this based on the amount of cards in the column
# this sets the max length of the y_offset
# NOTE: if this value is larger then the calculated offset, it means it would result in column overlap and will be ignored
MAX_Y_OFFSET = 50
SUITS = ["H", "S", "D", "C"]