Commit 134de3bf by BellCodeEditor

save project

parent ef795e26
Showing with 14 additions and 10 deletions
...@@ -21,6 +21,8 @@ volume = 0 #音量初始化 ...@@ -21,6 +21,8 @@ volume = 0 #音量初始化
click = 0.0 #点击次数初始化 click = 0.0 #点击次数初始化
pygame.mixer.music.set_volume(volume) #音量 pygame.mixer.music.set_volume(volume) #音量
pygame.mixer.music.play() #播放 pygame.mixer.music.play() #播放
music_list = ['HOYO-MiX - Genshin Impact Main Theme 原神.mp3','HOYO-MiX - Dream Aria (Genshin Impact Main Theme Var.) 梦之咏叹.mp3','HOYO-MiX - 神女劈观·唤情 Devastation and Redemption.mp3']
num = -1
while True: while True:
for event in pygame.event.get(): for event in pygame.event.get():
...@@ -43,16 +45,18 @@ while True: ...@@ -43,16 +45,18 @@ while True:
#播放/暂停 #播放/暂停
if event.type == locals.MOUSEBUTTONDOWN: if event.type == locals.MOUSEBUTTONDOWN:
if event.button == 1: if event.button == 1:
click += 1 mouse_x,mouse_y = event.pos
print("click" + str(click)) if mouse_x > 270 and mouse_x < 370 and mouse_y > 350 and mouse_y < 450:
if click%2 == 0: click += 1
pygame.mixer.music.unpause() print("click" + str(click))
play = stop_img if click%2 == 0:
if pygame.mixer.music.get_busy() == False: pygame.mixer.music.unpause()
pygame.mixer.music.play() play = stop_img
else: if pygame.mixer.music.get_busy() == False:
play = play_img pygame.mixer.music.play()
pygame.mixer.music.pause() else:
play = play_img
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