Commit 052a11e5 by BellCodeEditor

save project

parent 616bba4c
Showing with 5 additions and 5 deletions
...@@ -14,7 +14,7 @@ pygame.mixer.music.load('test.wav') ...@@ -14,7 +14,7 @@ pygame.mixer.music.load('test.wav')
fps = pygame.time.Clock() fps = pygame.time.Clock()
volume = 0.5 volume = 0.5
click = 0 click = 0
play_botton = stop play_button = stop
pygame.mixer.music.set_volume(volume) pygame.mixer.music.set_volume(volume)
while True: while True:
...@@ -22,17 +22,17 @@ while True: ...@@ -22,17 +22,17 @@ while True:
if event.type == locals.QUIT: if event.type == locals.QUIT:
exit() exit()
if event.type == locals.MOUSEBUTTONDOWN: if event.type == locals.MOUSEBUTTONDOWN:
if event.botton == 1: if event.button == 1:
x,y = event.pos x,y = event.pos
if x >= 270 and x <= 370 and y >= 330 and y <= 430: if x >= 270 and x <= 370 and y >= 330 and y <= 430:
if click == 0: if click == 0:
click = 1 click = 1
pygame.mixer.music.pause() pygame.mixer.music.pause()
play_botton = play play_button = play
else: else:
click = 0 click = 0
pygame.mixer.music.unpause() pygame.mixer.music.unpause()
play_botton = stop play_button = stop
if event.type == locals.KEYDOWN: if event.type == locals.KEYDOWN:
if event.key == locals.K_DOWN: if event.key == locals.K_DOWN:
if volume > 0: if volume > 0:
...@@ -48,7 +48,7 @@ while True: ...@@ -48,7 +48,7 @@ while True:
screen.blit(background,(0,0)) screen.blit(background,(0,0))
screen.blit(logo,(170,60)) screen.blit(logo,(170,60))
screen.blit(play_botton,(270,330)) screen.blit(play_button,(270,330))
screen.blit(last,(120,350)) screen.blit(last,(120,350))
screen.blit(next,(420,350)) screen.blit(next,(420,350))
pygame.display.update() pygame.display.update()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment