Commit 60f1c53f by BellCodeEditor

save project

parent 883662d4
Showing with 7 additions and 3 deletions
......@@ -13,8 +13,9 @@ next_img = pygame.image.load('next.png') # 下一曲按钮
logo_img = pygame.image.load('logo.png') # 下一曲按钮
# 载入音乐
pygame.mixer.music.load('歌曲4.ogg') # 载入音乐
filelist=["歌曲1.waw","歌曲2.waw","歌曲3.waw","歌曲4.ogg"]
#pygame.mixer.music.load('歌曲4.ogg') # 载入音乐
num=-1
volume = 0.2
pygame.mixer.music.set_volume(volume) # 初始播放音量
click = 0
......@@ -40,7 +41,7 @@ while True:
if event.type == locals.MOUSEBUTTONDOWN:
if event.button==1:
x,y=event.pos
if x>270 and y>330 and y<430
if x>270 and y>330 and y<430:
click += 1
if click % 2 == 0:
play_button = stop_img
......@@ -50,6 +51,9 @@ while True:
pygame.mixer.music.pause()
if pygame.mixer.music.get_busy() == False:
num+=1
if num>len(filelist)-1:
pygame.mixer.music.load(filelist[num])
pygame.mixer.music.play()
# 绘制画面
......
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