-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
41 lines (34 loc) · 909 Bytes
/
main.py
File metadata and controls
41 lines (34 loc) · 909 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
31
32
33
34
35
36
37
38
39
40
41
from __future__ import division
import pygame
from pygame.locals import *
import math, random
import sys,os
from manager import Manager
title = pygame.image.load(os.path.join("Art","title.png"))
def main():
pygame.init()
pygame.mixer.music.load("rematch.mp3")
pygame.mixer.music.play(-1)
screen = pygame.display.set_mode((1024, 1024))
clock = pygame.time.Clock()
game_manager = Manager()
b = True
while b:
screen.blit(title,(0,0))
pygame.display.flip()
for e in pygame.event.get():
pass
keys = pygame.key.get_pressed()
if keys[K_SPACE]:
break
while True:
clock.tick(30)
for e in pygame.event.get():
if e.type == QUIT or (e.type == KEYDOWN and e.key == K_ESCAPE):
pygame.quit()
return
keys = pygame.key.get_pressed()
game_manager.update(keys)
game_manager.draw(screen)
pygame.display.flip()
main()