jjj
parent
9f414b45c7
commit
ed3d72350b
24
main.py
24
main.py
|
|
@ -12,6 +12,8 @@ from pygame.locals import (
|
|||
K_ESCAPE,
|
||||
KEYDOWN,
|
||||
QUIT,
|
||||
K_SPACE,
|
||||
K_f,
|
||||
)
|
||||
|
||||
pygame.mixer.init()
|
||||
|
|
@ -50,6 +52,28 @@ bg =pygame.image.load("sprites/Graveyard.png").convert()
|
|||
|
||||
clock = pygame.time.Clock()
|
||||
|
||||
while Start:
|
||||
for event in pygame.event.get():
|
||||
if event.type==KEYDOWN:
|
||||
if event.type==K_SPACE:
|
||||
Start = False
|
||||
if event.key ==K_f:
|
||||
Start = False
|
||||
elif event.type == QUIT:
|
||||
Start = False
|
||||
screen.fill((0,0,0))
|
||||
text= my_font.render("Start",True,(255,255,255))
|
||||
screen.blit(text,(
|
||||
(SCREEN_WIDTH-text.get_width())/2,
|
||||
(SCREEN_HEIGHT-text.get_height())/2
|
||||
))
|
||||
text = my_font.render("Press Space", True, (255,255,255))
|
||||
screen.blit(text, (
|
||||
(SCREEN_WIDTH-text.get_width())/2
|
||||
(SCREEN_HEIGHT-text.get_height()-200)
|
||||
))
|
||||
pygame.display.flip()
|
||||
clock.tick(1000)
|
||||
while running:
|
||||
screen.blit(bg, (0,0))
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue