Commit b63a9973 by BellCodeEditor

save project

parent 8df9148f
Showing with 17 additions and 5 deletions
import os
pant = 'C:\\Users\\yang\\Music'
fiielist = os.listdir(pant)
print(fiielist)
\ No newline at end of file
......@@ -2,7 +2,7 @@ import pygame
from pygame import locals
pygame.init() # 初始化
click = 0
# 创建窗口
screen = pygame.display.set_mode((640, 480))
# 载入图片、资源
......@@ -12,8 +12,10 @@ stop_img = pygame.image.load('stop.png') # 暂停按钮
last_img = pygame.image.load('last.png') # 上一曲按钮
next_img = pygame.image.load('next.png') # 下一曲按钮
logo_img = pygame.image.load('logo.png') # 下一曲
pygame.mixer.music.set_volume("歌曲2".wav)
#pygame.mixer.music.("歌曲2".wav)
volum = 0.2
music_list=[]
num=-1
pygame.mixer.music.set_volume(volum)
while True:
for event in pygame.event.get():
......@@ -26,12 +28,16 @@ while True:
volume = 1
pygame.mixer.music.set_volume(volume)
if event.type == locals.MOUSEBUTTONDOWN:
clik += 1
click += 1
if click % 2 == 0:
pygeme mixer.music.unpause()
pygame.mixer.music.unpause()
else:
pygeme mixer.music.pause()
pygame.mixer.music.pause()
if pygame.mixer.music.get_busy()==False:
num += 1
if num > len (music_list)-1:
num =0
pygame.mixer.music.load(music_list[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