-
Notifications
You must be signed in to change notification settings - Fork 2
/
main.py
73 lines (60 loc) · 1.86 KB
/
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#OSGCC 6 a
import pygame, sys
from player import *
from world import *
from level import *
from menu import *
background = pygame.image.load("images/titlescreen.png")
backgroundRect = background.get_rect()
def main():
clock = pygame.time.Clock()
FPS = 60
world = World()
player = Player([800,450], world)
level = Level(world)
world.addPlayer(player)
world.setLevel(level)
pygame.mixer.music.load("sounds/game_01.ogg")
pygame.mixer.music.play(-1)
pygame.mixer.music.set_volume(.3)
while True:
if world.Update() == -1:
world = World()
player = Player([800,450], world)
level = Level(world)
world.addPlayer(player)
world.setLevel(level)
pygame.display.update()
clock.tick(FPS)
def menuScreen():
pygame.init()
pygame.mixer.init()
pygame.mixer.music.load("sounds/menu_02.ogg")
pygame.mixer.music.play(-1)
pygame.mixer.music.set_volume(.4)
surface = pygame.display.set_mode((1600,900)) #0,6671875 and 0,(6) of HDd resoultiondd
surface.blit(background, backgroundRect)
f = pygame.font.Font(None, 128)
surf = f.render("SUPER ROTISSERIE DX.", 1, (255,255,255), (0,0,255))
surface.blit(surf, backgroundRect)
menu = Menu()#necessary
menu.set_colors((255,255,255), (0,0,255), (0,0,0))#optional
menu.set_fontsize(64)#optional
menu.move_menu(400, 200)#optional
menu.init(['Start'], surface)#necessary
#menu.move_menu(0, 0)#optional
menu.draw()#necessary
pygame.key.set_repeat(199,69)#(delay,interval)
pygame.display.update()
#surface.blit(background, backgroundRect)
while 1:
for event in pygame.event.get():
if event.type == KEYDOWN:
if event.key == pygame.K_RETURN:
main()
if event.key == pygame.K_ESCAPE:
pygame.display.quit()
sys.exit()
if __name__ == '__main__':
menuScreen()
#main()