Commit 4166d14b by BellCodeEditor

save project

parent 6293f598
Showing with 11 additions and 0 deletions
import pygame import pygame
from pygame import locals from pygame import locals
a=0.2 a=0.2
b=0
play_button=stop_ing
pygame.mixer.music.set_volume(a) pygame.mixer.music.set_volume(a)
pygame.init() # 初始化 pygame.init() # 初始化
# 创建窗口 # 创建窗口
...@@ -27,6 +29,15 @@ while True: ...@@ -27,6 +29,15 @@ while True:
a-=0.1 a-=0.1
if a<0: if a<0:
a=0 a=0
if event.type==MOUSEBUTTONDOWN:
b+=1
if b%2==0:
pygame.mixer.music.unpause()
play_button=stop_ing
else:
pygame.mixer.music.unpause.pause()
play_button=play_ing
screen.blit(play_button.())
pygame.mixer.music.set_volume(a) pygame.mixer.music.set_volume(a)
if pygame.mixer.music.get_busy()==False: if pygame.mixer.music.get_busy()==False:
pygame.mixer.music.play() pygame.mixer.music.play()
......
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