Commit db999dd8 by BellCodeEditor

auto save

parent 7f0e812b
Showing with 3 additions and 12 deletions
import os
import pygame
from pygame import locals
a=os.listdir("C:\\Users\\Administrator\\Desktop\\d")
print(a)
pygame.init() # 初始化
for i in a
if a[-4:]=='.waw' or i[-4:]=='.ogg'
# 创建窗口
screen = pygame.display.set_mode((640, 480))
# 载入图片、资源
......@@ -15,12 +11,9 @@ stop_img = pygame.image.load('stop.png') # 暂停按钮
last_img = pygame.image.load('last.png') # 上一曲按钮
next_img = pygame.image.load('next.png') # 下一曲按钮
logo_img = pygame.image.load('logo.png') # 下一曲按钮
path="C:\\Users\\Administrator\\Desktop\\"
if pygame.mixer.music.get_busy==False:
unm=-1
#diaplay_fonts
# 载入音乐
pygame.mixer.music.load=[]# 载入音乐
pygame.mixer.music.load=['歌曲1.wav','歌曲2.wav','歌曲3.wav','歌曲3.wav','歌曲4.ogg']# 载入音乐
volume = 0.2
pygame.mixer.music.set_volume(volume) # 初始播放音量
......@@ -43,6 +36,7 @@ while True:
if volume < 0:
volume = 0
pygame.mixer.music.set_volume(volume)
# 按下鼠标
if event.type == locals.MOUSEBUTTONDOWN:
# 次数增加
......@@ -56,10 +50,7 @@ while True:
else:
play_button = play_img
pygame.mixer.music.pause()
if pygame.mixer.music.get_busy==False:
if pygame.mixer.music.get_busy() == False:
num += 1
if num > len(pygame.mixer.music.load)-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