-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsettings.py
95 lines (69 loc) · 1.93 KB
/
settings.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
""" constants and global var """
from typing import NewType
Color = NewType('Color', str)
# global score
score: dict[str, int] = {'RIGHT': 0, 'LEFT': 0,}
# debugs
CHEATS = True
SHOW_HITBOX = True # draw the rect
SHOW_DIRECTIONS = True # draw a line
INVISIBILITY = CHEATS # dont die
DEBUG_POS = False
DEBUG_STACK = False # print stack
DEBUG_SCORE = False # print score and highscore
WIN_SCORE = 10
# screen
WIDTH = 1024
HEIGHT = 512
FPS = 60
WIDTH_BACKUP = WIDTH
HEIGHT_BACKUP = HEIGHT
APPROX_CORNER_COLLISION = 10
# GOAL
GOAL_TOP = HEIGHT * 0.1
GOAL_BOTTOM = HEIGHT * 0.9
# keys
# pylint: disable=too-few-public-methods
class P1Keys:
""" hold the keybinds of the player 1 """
RIGHT = 'd'
LEFT = 'a'
UP = 'w'
DOWN = 's'
class P2Keys:
""" hold the keybinds of the player 2 """
RIGHT = 'RIGHT'
LEFT = 'LEFT'
UP = 'UP'
DOWN = 'DOWN'
# pylint: enable=too-few-public-methods
# BACKGROUND COLORS
BACKGROUND_COLOR = Color('#000000') # to replace with assets
PAUSE_BACKGROUND_COLOR = Color('#ffff00')
MAINMENU_BACKGROUND_COLOR = Color('#00ffff')
GAMEOVER_BACKGROUND_COLOR = Color('#ff0000')
WIN_BACKGROUND_COLOR = Color('#00ff00')
SETTINGS_BACKGROUND_COLOR = Color('#00ffff')
HITBOX_COLOR = Color('#ff0000')
DIRECTION_COLOR = Color('#0000ff')
TRANSPARENCY_ALPHA = 150
SCORE_COLOR = '#ffffff'
# default font. There also is a bold and a mono variant.
FONT_NAME = 'font/PixeloidSans.ttf'
FONT_SIZE = 30
FONT_COLOR = Color('#000000')
# entities
MAX_BALLS = 10
BALL_RADIUS = 8
# those are change for each difficulty, default is normal difficulty.
####################################################################
POWERUP_BIG_PADLLE_DURATION = 10 # in second
POWERUP_SPEED = 2
BALL_MULTIPLYER = 2 # for every ball spawn X more ball
# percentages
POWERUP_PADDLE_SIZE = 1.5
POWERUP_PADDLE_CHANCE = 5
POWERUP_BALL_CHANCE = 5
MAX_BOUNCE_ANGLE = 60
BALL_SPEED = 7
PADDLE_SPEED = 8