Commit ec790039 by BellCodeEditor

save project

parent abf00ec0
Showing with 13 additions and 0 deletions
...@@ -17,8 +17,21 @@ while True: ...@@ -17,8 +17,21 @@ while True:
if event.type == locals.QUIT: if event.type == locals.QUIT:
exit() exit()
if pygame .mixer.music.get_busy() == False: if pygame .mixer.music.get_busy() == False:
pygame.mixer.music.play() pygame.mixer.music.play()
click = 0
if event.type == locals.MOUSEBUTTONDOWN
click += 1
if click % 2 == 0:
play_button = stop_img
pygame.mixer.music.unpause()
else:
play_button = play_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(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