Commit 53fa6f89 by BellCodeEditor

save project

parent 174ed269
Showing with 11 additions and 10 deletions
...@@ -14,6 +14,7 @@ logo_img = pygame.image.load('logo.png') # 中间logo ...@@ -14,6 +14,7 @@ logo_img = pygame.image.load('logo.png') # 中间logo
pygame.mixer.music.load('歌曲4.ogg') pygame.mixer.music.load('歌曲4.ogg')
n=0 n=0
v=0.5 v=0.5
play_button=stop_img
pygame.mixer.music.set_volume(v) pygame.mixer.music.set_volume(v)
while True: while True:
...@@ -37,15 +38,15 @@ while True: ...@@ -37,15 +38,15 @@ while True:
else: else:
v-=0.1 v-=0.1
pygame.mixer.music.set_volume(v) pygame.mixer.music.set_volume(v)
if event.type == locals.KEYDOWN:
if event.key == locals.MOUSEBUTTONDOWN: if event.type == locals.MOUSEBUTTONDOWN:
n+=1 n+=1
if n % 2 ==0: if n % 2 == 0:
play_button=stop_img play_button=stop_img
pygame.mixer.music.unpause() pygame.mixer.music.unpause()
else: else:
play_button=play_img play_button=play_img
pygame.mixer.music.pause() pygame.mixer.music.pause()
...@@ -56,7 +57,7 @@ while True: ...@@ -56,7 +57,7 @@ while True:
# 绘制画面 # 绘制画面
screen.blit(bg_img, (0, 0)) # 填充背景 screen.blit(bg_img, (0, 0)) # 填充背景
screen.blit(stop_img, (270, 330)) # 暂停按钮 screen.blit(play_button, (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