Commit 31bfc9e3 by BellCodeEditor

save project

parent 048f9bc4
Showing with 11 additions and 2 deletions
...@@ -14,6 +14,8 @@ logo_img = pygame.image.load('logo.png') # 中间logo ...@@ -14,6 +14,8 @@ logo_img = pygame.image.load('logo.png') # 中间logo
pygame.mixer.music.load("歌曲4.ogg") pygame.mixer.music.load("歌曲4.ogg")
pygame.mixer.music.play() pygame.mixer.music.play()
p_b = stop_img
cc = 0
vl = 0.5 vl = 0.5
pygame.mixer.music.set_volume(vl) pygame.mixer.music.set_volume(vl)
...@@ -32,10 +34,17 @@ while True: ...@@ -32,10 +34,17 @@ while True:
vl -= 0.02 vl -= 0.02
if vl < 0: if vl < 0:
vl = 0 vl = 0
if event.type == locals.MOUSEBUTTONDOWN:
cc += 1
if cc % 2 == 1:
p_b = play_img
pygame.mixer.music.pause()
else:
p_b = stop_img
pygame.mixer.music.unpause()
# 绘制画面 # 绘制画面
screen.blit(bg_img, (0, 0)) # 填充背景 screen.blit(bg_img, (0, 0)) # 填充背景
screen.blit(stop_img, (270, 330)) # 暂停按钮 screen.blit(p_b, (270, 330)) # 暂停按钮
screen.blit(logo_img, (170, 60)) # 中间logo图 screen.blit(logo_img, (170, 60)) # 中间logo图
screen.blit(last_img, (120, 350)) # 上一曲 screen.blit(last_img, (120, 350)) # 上一曲
screen.blit(next_img, (420, 350)) # 下一曲 screen.blit(next_img, (420, 350)) # 下一曲
......
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