Commit 157e1e2c by BellCodeEditor

auto save

parent c075cadc
Showing with 26 additions and 1 deletions
import pygame
from pygame import locals
#初始化
pygame.init()
# 创建窗口
screen=pygame.display.set_mode((660,480))
# 载入图片、资源
background=pygame.image.load('background.png')
last=pygame.image.load('last.png')
logo=pygame.image.load('logo.png')
nt=pygame.image.load('next.png')
play=pygame.image.load('play.png')
stop=pygame.image.load('stop.png')
pygame.mixer.music.load('Alarm_Rooster_02.ogg')
pygame.mixer.music.play()
while True:
for event in pygame.event.get():
if event.type==locals.QUIT:
exit()
#绘制画面
screen.blit(background,(0,0))
screen.blit(play, (270, 330))
#刷新画面
pygame.display.update()
......@@ -34,7 +34,7 @@ while True:
pygame.mixer.music.set_volume(volume)
if event.key == locals.K_DOWN:
volume -= 0.1
if volume < 0 <or volume==0:
if volume < 0 or volume==0:
volume = 0
pygame.mixer.music.set_volume(volume)
if event.type == locals.MOUSEBUTTONDOWN:
......
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