-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.py
42 lines (30 loc) · 1.16 KB
/
config.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
from sound import Sound
import os
import pygame
from theme import Theme
class Config:
def __init__(self):
self.themes = []
self._add_themes()
self.idx = 0
self.theme = self.themes[self.idx]
#font
self.font = pygame.font.SysFont('monospace', 20, bold=True)
#sound
self.move_sound = Sound(
os.path.join("assets/sounds/move.wav")
)
self.capture_sound = Sound(
os.path.join("assets/sounds/capture.wav")
)
def change_theme(self):
self.idx += 1
self.idx %= len(self.themes)
self.theme = self.themes[self.idx]
def _add_themes(self):
green = Theme((234, 235, 200), (119, 154, 88), (244, 247, 116), (172, 195, 51), '#C86464', '#C84646')
brown = Theme((235, 209, 166), (165, 117, 80), (245, 234, 100), (209, 185, 59), '#C86464', '#C84646')
blue = Theme( (126, 155, 230), (27, 70, 179), (123, 187, 227), (43, 119, 191), '#C86464', '#C84646')
gray = Theme((120, 119, 118), (86, 85, 84), (99, 126, 143), (82, 102, 128), '#C86464', '#C84646')
self.themes = [green, brown, blue, gray]
# Path: main.py