Commit 760a34ac by BellCodeEditor

save project

parent b5055671
Showing with 12 additions and 4 deletions
import pygame
from pygame import locals
l9 = 0
pygame.init() # 初始化
# 创建窗口
screen = pygame.display.set_mode((640, 480))
......@@ -28,7 +28,16 @@ while True:
qqwwee-=0.1
if qqwwee<1:
qqwwee=0
pygame.mixer.music.set_volume(qqwwee)
pygame.mixer.music.set_volume(qqwwee)
if event.type ==locals.MOUSEBUTTONDOWN:
l9 += 1
if l9 % 2 == 0:
play_button = stop_img
pygame.mixer.music.unpause()
else:
play_button = play_img
pygame.mixer.music.pause()
if pygame.mixer.music.get_busy()==False:
pygame.mixer.music.play()
......@@ -39,4 +48,4 @@ while True:
screen.blit(last_img, (120, 350)) # 上一曲
screen.blit(next_img, (420, 350)) # 下一曲
# 刷新画面
pygame.display.update()
\ No newline at end of file
pygame.display.update()
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