Commit 605c463c by BellCodeEditor

save project

parent 11f8a971
Showing with 27 additions and 1 deletions
......@@ -21,6 +21,7 @@ play = stop_img #播放/暂停图标状态初始化
volume = 1 #音量初始化
click = 0.0 #点击次数初始化
pygame.mixer.music.set_volume(volume) #音量
angle = 0
while True:
for event in pygame.event.get():
......@@ -59,12 +60,37 @@ while True:
else:
play = play_img
pygame.mixer.music.pause()
#上一曲
if mouse_x > 120 and mouse_x < 220 and mouse_y > 350 and mouse_y < 400:
num -= 1
print(num)
if num < 0:
num = len(music_list) - 1
pygame.mixer.music.load(music_list[num])
pygame.mixer.music.play()
click = 0
play = stop_img
#下一曲
if mouse_x > 420 and mouse_x < 520 and mouse_y > 350 and mouse_y < 450:
num += 1
print(num)
if num > len(music_list) - 1:
num = 0
pygame.mixer.music.load(music_list[num])
pygame.mixer.music.play()
click = 0
play = stop_img
logo = pygame.transform.rotate(logo_img,angle)
new_logo = logo.get_rect(center=(320,200))
pos = (new_logo[0],new_logo[1])
if play == stop_img:
angle += 0.5
# 绘制画面
screen.blit(bg_img, (0, 0)) # 填充背景
screen.blit(play, (270, 330)) # 暂停按钮
screen.blit(logo_img, (170, 60)) # 中间logo图
screen.blit(logo, pos) # 中间logo图
screen.blit(last_img, (120, 350)) # 上一曲
screen.blit(next_img, (420, 350)) # 下一曲
#绘制音量
......
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