Commit 432ff6d5 by BellCodeEditor

save project

parent 96b49b31
Showing with 13 additions and 7 deletions
...@@ -5,17 +5,23 @@ pygame.init() # 初始化 ...@@ -5,17 +5,23 @@ pygame.init() # 初始化
# 创建窗口 # 创建窗口
screen = pygame.display.set_mode((640, 480)) screen = pygame.display.set_mode((640, 480))
# 载入图片、资源 # 载入图片、资源
bg_img = pygame.image.load('backgrand.png') bg_img = pygame.image.load('background.png') # 背景图
play_img = pygame.image.load('play.png') play_img = pygame.image.load('play.png') # 播放按钮
stop_img = pygame.image.load('stop.png') stop_img = pygame.image.load('stop.png') # 暂停按钮
last_img = pygame.image.load('last.png') last_img = pygame.image.load('last.png') # 上一曲按钮
next_img = pygame.image.load('next.png') next_img = pygame.image.load('next.png') # 下一曲按钮
logo_img = pygame.image.load('logo.png') logo_img = pygame.image.load('logo.png') # 中间logo
pygame.mixer.music.logo('歌闃4.ogg') pygame.mixer.music.load('歌曲4.ogg')
pygame.mixer.music.play()
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:
exit() exit()
if pygame.mixer.music.get_busy() == False:
pygame.mixer.music.play()
# 绘制画面 # 绘制画面
screen.blit(bg_img, (0, 0)) # 填充背景 screen.blit(bg_img, (0, 0)) # 填充背景
......
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