Commit 7e2b09b7 by BellCodeEditor

save project

parent d84a6645
Showing with 13 additions and 1 deletions
File added
......@@ -11,9 +11,11 @@ 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') # 中间logo
pygame.mixer.music.load('歌曲1.wav')
pygame.mixer.music.load('1595303624.mp3')
a=0.5
pygame.mixer.music.set_volume(a)
b=0
play_button=stop_img
while True:
for event in pygame.event.get():
if event.type == locals.QUIT:
......@@ -31,6 +33,16 @@ while True:
if a<0:
a=0
pygame.mixer.music.set_volume(a)
if event.type == locals.MOUSEBUTTONDOWN:
b += 1
if b % 2 == 0:
play_button = stop_img
pygame.mixer.music.unpause()
else:
play_button = play_img
pygame.mixer.music.pause()
# 绘制画面
screen.blit(bg_img, (0, 0)) # 填充背景
screen.blit(stop_img, (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