Commit 13610887 by BellCodeEditor

save project

parent 2bd36264
Showing with 7 additions and 2 deletions
import pygame import pygame
import os
filelist=os.listdir("C:\\Users\\Administrator\\Desktop\\test")
for file in filelist:
if file[-4:]=='.wav' or file[-3:]=='.ohh':
print(file)
from pygame import locals from pygame import locals
print(filelist)
pygame.init() # 初始化 pygame.init() # 初始化
# 创建窗口 # 创建窗口
screen = pygame.display.set_mode((640, 480)) screen = pygame.display.set_mode((640, 480))
...@@ -54,7 +59,7 @@ while True: ...@@ -54,7 +59,7 @@ while True:
sb+=1 sb+=1
if sb > 3: if sb > 3:
sb = 0 sb = 0
pygame.mixer.music.load(music_list[sb]) pygame.mixer.music.load(filelist[sb])
pygame.mixer.music.play() 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