Commit d7390c1b by BellCodeEditor

auto save

parent 12113d56
Showing with 2 additions and 8 deletions
import pygame
from pygame import locals
import os
pygame.init() # 初始化
path="C:\\Users\\Administrator\\Desktop"
filelist=os.listdir(path)
for file in filelist:
if file[-4:]==".wav" or file[-4:]=="ogg":
music_list.append(file)
# 创建窗口
screen = pygame.display.set_mode((640, 480))
# 载入图片、资源
bg_img = pygame.image.load('background.png') # 背景图
......@@ -56,10 +52,8 @@ while True:
pygame.mixer.music.pause()
if pygame.mixer.music.get_busy() == False:
pygame.mixer.music.play()
# 绘制画面
screen.blit(bg_img, (0, 0)) # 填充背景
screen.blit(play_button, (270, 330)) # 暂停按钮
......
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