-
Notifications
You must be signed in to change notification settings - Fork 2
/
main.py
32 lines (27 loc) · 797 Bytes
/
main.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
# Import files and libraries
import pygame
from pygame.locals import *
from pygame import mixer
from assets import globals, scene
# Initialise pygame and create window
pygame.init()
screen = pygame.display.set_mode((globals.WINDOW_WIDTH, globals.WINDOW_HEIGHT))
pygame.display.set_caption('Quantum Breakout')
clock = pygame.time.Clock()
mixer.init()
mixer.music.load('./assets/8BitAdventure.ogg')
mixer.music.set_volume(0.9)
mixer.music.play()
def main():
# initialize game
scene_manager = scene.SceneManager()
scene_manager.push(scene.GameScene())
while not scene_manager.exit:
# update game
scene_manager.update()
# draw game
scene_manager.draw(screen)
# control framerate
clock.tick(60)
if __name__ == '__main__':
main()