Commit 0a18c99c by BellCodeEditor

save project

parent 6769ed72
Showing with 7 additions and 15 deletions
...@@ -26,16 +26,6 @@ while True: ...@@ -26,16 +26,6 @@ while True:
exit() exit()
# 按键,控制声音大小 # 按键,控制声音大小
if event.type == locals.KEYDOWN: if event.type == locals.KEYDOWN:
if event.button ==1:
x,y==event.pos
if x<370 and x>270 and y<450 and y>350:
click+=1
if click%2==0:
play_button=stop_img
pygame.mixer.music.unpause
else:
play_button=play_img
pygame.mixer.music.pause
if event.key == locals.K_UP: if event.key == locals.K_UP:
volume += 0.1 volume += 0.1
if volume > 1: if volume > 1:
...@@ -50,11 +40,13 @@ while True: ...@@ -50,11 +40,13 @@ while True:
# 按下鼠标 # 按下鼠标
if event.type == locals.MOUSEBUTTONDOWN: if event.type == locals.MOUSEBUTTONDOWN:
# 次数增加 if event.button ==1:
click += 1 x,y = event.pos
if click % 2 == 0: if x<370 and x>270 and y<450 and y>350:
play_button = stop_img click += 1
pygame.mixer.music.unpause() if click % 2 == 0:
play_button = stop_img
pygame.mixer.music.unpause()
else: else:
play_button = play_img play_button = play_img
pygame.mixer.music.pause() pygame.mixer.music.pause()
......
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