-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathResources.py
34 lines (26 loc) · 1014 Bytes
/
Resources.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
import os
import sys
from enum import Enum
import pygame
if getattr(sys, "frozen", False):
BASE_PATH = os.path.dirname(os.path.abspath(sys.executable))
else:
BASE_PATH = os.path.dirname(__file__)
RESOURCE_PATH = os.path.join(BASE_PATH, "resources")
AUDIO = os.path.join(RESOURCE_PATH, "audio")
FONTS = os.path.join(RESOURCE_PATH, "fonts")
IMGS = os.path.join(RESOURCE_PATH, "imgs")
pygame.mixer.init()
class Sounds(Enum):
MOVE = pygame.mixer.Sound(os.path.join(AUDIO, "move.wav"))
SPEED = pygame.mixer.Sound(os.path.join(AUDIO, "speed.mp3"))
class Fonts(Enum):
STAR_BORN = os.path.join(FONTS, "Starborn.otf")
BLACK_BIRD = os.path.join(FONTS, "Black Bird.otf")
class Images(Enum):
KING = os.path.join(IMGS, "king.png")
HOME = os.path.join(IMGS, "home.png")
FLAG = os.path.join(IMGS, "flag.png")
REFRESH = os.path.join(IMGS, "refresh.png")
BACKGROUND = os.path.join(IMGS, "background.png")
ICON = os.path.join(IMGS, "icon.png")