Commit 05298656 by BellCodeEditor

save project

parent 85b35737
Showing with 17 additions and 8 deletions
......@@ -11,16 +11,23 @@ stop_img = pygame.image.load('stop.png') # 暂停按钮
last_img = pygame.image.load('last.png') # 上一曲按钮
next_img = pygame.image.load('next.png') # 下一曲按钮
logo_img = pygame.image.load('logo.png') # 中间logo
pygame.mixer.music.load("歌曲4.ogg")
d=["歌曲1.wav","歌曲2.wav","歌曲3.wav","歌曲4.wav"]
a=1
b=0
c=stop_img
e=-1
pygame.mixer.music.set_volume(a)
while True:
for event in pygame.event.get():
if event.type==locals.QUIT:
exit()
if pygame.mixer.music.get_busy() == False:
e+=1
if e>len(d)-1:
e=0
pygame.mixer.music.load(d[e])
pygame.mixer.music.play()
if event.type==locals.KEYDOWN:
if event.key==locals.K_DOWN:
......@@ -34,13 +41,15 @@ while True:
a=1
pygame.mixer.music.set_volume(a)
if event.type==locals.MOUSEBUTTONDOWN:
b+=1
if b%2==0:
pygame.mixer.music.unpause()
c=stop_img
else:
pygame.mixer.music.pause()
c=play_img
x,y=event.pos
if x>270 and x<370 and y>300 and y<400:
b+=1
if b%2==0:
pygame.mixer.music.unpause()
c=stop_img
else:
pygame.mixer.music.pause()
c=play_img
# 绘制画面
screen.blit(bg_img, (0, 0)) # 填充背景
......
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