Commit be980241 by BellCodeEditor

save project

parent 8c69ba99
Showing with 11 additions and 6 deletions
import pygame
from pygame import locals
import os
pygame.init() # 初始化
# 创建窗口
screen = pygame.display.set_mode((640, 480))
......@@ -13,7 +13,13 @@ next_img = pygame.image.load('next.png') # 下一曲按钮
logo_img = pygame.image.load('logo.png') # 中间logo
pygame.mixer.music.load('歌曲4.ogg')
asdwwwwas = ['歌曲4.ogg','歌曲1.wav','歌曲2.wav','歌曲3.wav']
w = []
qq="C:\\Users\\86130\\Desktop\\text"
l=os.listdir(qq)
for i in l:
if i[-4:]==".wav" or i[-4:]==".ogg":
w.append(i)
a=0.2
pygame.mixer.music.set_volume(a)
......@@ -38,8 +44,7 @@ while True:
a=0
pygame.mixer.music.set_volume(a)
if event.type == locals.MOUSEBUTTONDOWN:
if button == 1:
if
if x>270 and x<370 and y >350 and y<450:
ades += 1
if ades % 2 == 1:
pygame.mixer.music.pause()
......@@ -50,9 +55,9 @@ while True:
if pygame.mixer.music.get_busy()==False:
m += 1
if m > len(asdwwwwas)-1:
if m > len(w)-1:
m = 0
pygame.mixer.music.load(asdwwwwas[m])
pygame.mixer.music.load(qq+"\\"+w[m])
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