/
CONSTANTS.py
49 lines (41 loc) · 1.34 KB
/
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
46
47
48
49
###################################################################
#Purpose: This is the constants class, it creates all the contants#
#so they can be shared universally among other classes #
###################################################################
#import dependencies
import pygame
#font constants
pygame.font.init()
ARIAL = pygame.font.SysFont("arial", 10)
FONT = pygame.font.Font('font.ttf', 23)
FONT_BIG = pygame.font.Font('font.ttf', 40)
FONT_BIGGEST = pygame.font.Font('font.ttf', 100)
#sound constants
pygame.mixer.init()
pygame.mixer.music.load("music.mp3")
pygame.mixer.music.play(True) #plays background music
SOUND_SHOT = pygame.mixer.Sound(file="shot.ogg")
SOUND_ROCKET = pygame.mixer.Sound(file="rocket.ogg")
SOUND_POINT = pygame.mixer.Sound(file="point.ogg")
SOUND_GAMEOVER = pygame.mixer.Sound(file="gameover.ogg")
SOUND_BUTTON = pygame.mixer.Sound(file="button.ogg")
#creates universal clock object
CLOCK=pygame.time.Clock()
#constants to tell rendering how much to scale up the spheres
SCALEUP = 50
#color constants
BLACK = ( 0, 0, 0)
WHITE = (255, 255, 255)
BLUE = ( 0, 0, 255)
GREEN = ( 0, 255, 0)
RED = (255, 0, 0)
COLOR_BG = BLACK
COLOR_TEXT = WHITE
#game constants
INITIAL_SPHERES = 30
TIME_LIMIT = 120
SPHERES_LIMIT = 100
MAX=30
#screen constants
SIZE = [720, 720]
ORIGIN = [SIZE[0]/2,SIZE[1]/2]