Commit 92462b4c by BellCodeEditor

save project

parent 0ef83f2c
Showing with 12 additions and 7 deletions
...@@ -20,6 +20,8 @@ while True: ...@@ -20,6 +20,8 @@ while True:
for event in pygame.event.get(): for event in pygame.event.get():
if event.type==locals.QUIT: if event.type==locals.QUIT:
exit() exit()
if event.type==locals.KEYDOWN: if event.type==locals.KEYDOWN:
if event.key==locals.K_UP: if event.key==locals.K_UP:
v+=0.1 v+=0.1
...@@ -32,13 +34,16 @@ while True: ...@@ -32,13 +34,16 @@ while True:
v=-1 v=-1
pygame.mixer.music.set_volume(v) pygame.mixer.music.set_volume(v)
if event.type==locals.MOUSEBUTTONDOWN: if event.type==locals.MOUSEBUTTONDOWN:
c+=1 if event.button == 1:
if c%2==0: x,y= event.pos
pygame.mixer.music.unpause() if x>270 and x<370 and y>330 and y<430:
p=stop_img c+=1
else: if c%2==0:
pygame.mixer.music.pause() pygame.mixer.music.unpause()
p=play_img p=stop_img
else:
pygame.mixer.music.pause()
p=play_img
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