Commit f8f2a1a6 by BellCodeEditor

auto save

parent 1cada82b
Showing with 5 additions and 3 deletions
import pygame
from pygame import locals
vol=0.2
c
pygame.init() # 初始化
# 创建窗口
screen = pygame.display.set_mode((640, 480))
......@@ -26,9 +27,10 @@ while True:
vol -= 0.1
if vol<0:
vol=0
if pygame.mixer.music.get_busy==False:
pygame.mixer.music.player()
#设置音量
pygame.mixer.music.set_volume(vol)
if pygame.mixer.music.get_busy()==False:
pygame.mixer.music.play()
# 绘制画面
screen.blit(bg_img, (0, 0)) # 填充背景
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