-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmenu.py
More file actions
71 lines (60 loc) · 2.93 KB
/
Copy pathmenu.py
File metadata and controls
71 lines (60 loc) · 2.93 KB
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
from header import *
import draw
class menu:
FontHeadline: pygame.font
FontText: pygame.font
def init(self, fontProportions: int, screen, enemyList, background_x, background_y, background, BACKGROUND_WIDTH, BACKGROUND_HEIGHT):
FontText = pygame.font.SysFont('comicsans', fontProportions, True, True)
FontHeadline = pygame.font.SysFont('comicsans', 2 * fontProportions, True, True)
pygame.display.update()
import Yooter
Yooter.FramesPerSecond.tick(Yooter.FPS)
draw.draw_pause_menu(screen, enemyList, background_x, background_y, background, BACKGROUND_WIDTH, BACKGROUND_HEIGHT, screen.get_width(),
screen.get_height())
class pauseMenu(menu):
def loopMenu(self, screen, enemyList, background_x, background_y, background):
menuRunning: bool = True
while menuRunning == True:
menu.init(160, screen, enemyList, background_x, background_y, background, BACKGROUND_WIDTH, BACKGROUND_HEIGHT)
screen.blit(menu.FontHeadline.render("Pause", True, (0, 0, 0)), (
screen.get_width() / 2 - menu.FontHeadline.size()[0],
screen.get_height() / 2 - menu.FontHeadline.size()[1] / 2))
for event in pygame.event.get():
if event.type == pygame.KEYDOWN:
if event.key == pygame.K_ESCAPE:
menuRunning = False
if event.type == VIDEORESIZE:
import Yooter
Yooter.player_one.position_x = screen.get_width() / 2
Yooter.player_one.position_y = screen.get_height() / 2
class mainMenu(menu):
def loopMenu():
menuRunning: bool = True
while menuRunning == True:
menu.init(160)
screen.blit(FontText.render("Pause", True, (0, 0, 0)),
(screen.get_width() / 2 - FontText.size()[0], screen.get_height() / 2 - FontText.size()[1] / 2))
for event in pygame.event.get():
if event.type == VIDEORESIZE:
import Yooter
Yooter.player_one.position_x = screen.get_width() / 2
Yooter.player_one.position_y = screen.get_height() / 2
# pygame.draw.rect(screen.get_width()/2, screen.get_height()/2, 200, 20)
def shopMenu():
shopbool: bool = True
while shopbool:
mouse = pygame.mouse.get_pos()
"""
for event in pygame.event.get():
if event.type == QUIT:
running = False
pygame.quit()
elif event.type == VIDEORESIZE:
player_one.position_x = screen.get_width() / 2
player_one.position_y = screen.get_height() / 2
if event.type == pygame.MOUSEBUTTONDOWN:
if pygame.mouse.get_pressed(5)[0]:
if event.type == pygame.KEYDOWN:
if event.key == pygame.K_ESCAPE:
menuRunning = True
"""