Commit 2f925941 by BellCodeEditor

save project

parent b7b4818d
Showing with 21 additions and 7 deletions
import pygame
from pygame import locals
import os
pygame.init() # 初始化
# 创建窗口
screen = pygame.display.set_mode((640, 480))
# 载入图片、资源
from pygame
pygame.init()
bg_img = pygame.image.load('background.png') # 背景图
play_img = pygame.image.load('play.png') # 播放按钮
stop_img = pygame.image.load('stop.png') # 暂停按钮
......@@ -55,11 +51,29 @@ while True:
play_button = play_img
pygame.mixer.music.pause()
if x>120 and x<220 and y>350 and y<400:
num-=1
if num<0:
num = len(music_list)-1
pygame.mixer.music.load(path + "\\" + music_list[num])
pygame.mixer.music.play()
click = 0
play_button = stop_img
if x>320 and x<420 and y>350 and y<400:
num+=1
if num>3:
num = len(music_list)+1
pygame.mixer.music.load(path + "\\" + music_list[num])
pygame.mixer.music.play()
click = 3
play_button = stop_img
if pygame.mixer.music.get_busy() == False:
num += 1
if num > len(music_list)-1:
num = 0
pygame.mixer.music.load(path + '\\' + music_list[num])
pygame.mixer.music.load(path + "\\" + music_list[num])
pygame.mixer.music.play()
# 绘制画面
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