Commit b7dd9466 by BellCodeEditor

save project

parent 0aba8459
Showing with 6 additions and 6 deletions
......@@ -24,8 +24,11 @@ try:
for i in filelist:
if i[-4:]=='.wav'or i[-4:]=='.ogg':
musics.append(i)
print(2222)
print(33333)
except:
musics=['歌曲1.wav','歌曲2.wav','歌曲3.wav','歌曲4.ogg','test.wav']
print(11111)
false=1
else:
false=0
......@@ -39,8 +42,7 @@ while True:
volume += 0.1
if volume > 1:
volume = 1
pygame.mixer.music.set_volume(volume)
if event.key == locals.K_DOWN:
elif event.key == locals.K_DOWN:
volume -= 0.1
if volume < 0:
volume = 0
......@@ -67,12 +69,10 @@ while True:
else:
pygame.mixer.music.load(path+'\\'+musics[num])
pygame.mixer.music.play()
elif event.key==locals.K_RIGHT:
num+=1
if pygame.mixer.music.get_busy() == False:
num+=1
if num>len(musics)-1:
print(musics)
if num>=len(musics)-1:
num=0
if num<0:
num=len(musics)-1
......
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