Commit 4128044d by BellCodeEditor

save project

parent 426554cd
Showing with 9 additions and 4 deletions
import pygame
from pygame import locals
import os
pygame.init() # 初始化
# 创建窗口
screen = pygame.display.set_mode((640, 480))
......@@ -14,8 +14,13 @@ logo_img = pygame.image.load('logo.png') # 中间logo
s=0.55
click=0
f=0
m=['歌曲一.wav','歌曲二.wav','歌曲三.wav','歌曲四.ogg','test.wav']
f=-1
m=[]
s="C:\\Users\\5\\Desktop\\test"
c=os.listdir(s)
for i in c:
if c[-4:]=='.wav' or c[-4:]=='.ogg':
m.append(i)
k=stop_img
while True:
for event in pygame.event.get():
......@@ -51,7 +56,7 @@ while True:
f+=1
if f>len(m)-1:
f=0
pygame.mixer.music.load(m[f])
pygame.mixer.music.load(s+ '\\'+m[f])
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