Commit 2ba6852e by BellCodeEditor

save project

parent b3fedc38
Showing with 7 additions and 2 deletions
import pygame import pygame
from pygame import locals from pygame import locals
import os
pygame.init() # 初始化 pygame.init() # 初始化
# 创建窗口 # 创建窗口
screen = pygame.display.set_mode((640, 480)) screen = pygame.display.set_mode((640, 480))
...@@ -19,7 +19,12 @@ volume = 0.2 ...@@ -19,7 +19,12 @@ volume = 0.2
pygame.mixer.music.set_volume(volume) # 初始播放音量 pygame.mixer.music.set_volume(volume) # 初始播放音量
click = 0 click = 0
play_button = stop_img play_button = stop_img
music_list = []
path = "C:\\Users\\Administrator\\Desktop"
filelist = os.listdir(path)
for i in filelist:
if i[-4:] == ".wav" or i[-4:]==".ogg":
music_list.append(i)
while True: while True:
for event in pygame.event.get(): for event in pygame.event.get():
if event.type == locals.QUIT: if event.type == locals.QUIT:
......
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