-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgame_manager.py
More file actions
30 lines (21 loc) · 815 Bytes
/
game_manager.py
File metadata and controls
30 lines (21 loc) · 815 Bytes
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
import pygame, random
from os.path import join
from pygame.locals import *
# Initialize pygame library
pygame.mixer.init(frequency=22050, size=-16, channels=1, buffer=64)
pygame.init()
# Issue that mac and window handle the sound differently
try:
blip = pygame.mixer.Sound(join("assests","sounds","blip.wav"))
except:
blip = pygame.mixer.Sound(join("assests","sounds","blip.ogg"))
clock = pygame.time.Clock()
# Sets Visual and text
screen_settings = {
'height' : 400,
'width' : 800
}
screen = pygame.display.set_mode((screen_settings['width'], screen_settings['height']))
pygame.display.set_caption('Pong')
pygame.display.set_icon(pygame.image.load(join('assests','visuals','gaming.png')))
font = pygame.font.Font(join('assests','visuals','bit5x3.ttf'), 100)