Commit d44a57a6 by BellCodeEditor

save project

parent cce7c648
Showing with 16 additions and 3 deletions
...@@ -4,6 +4,8 @@ mix=pygame.mixer.music ...@@ -4,6 +4,8 @@ mix=pygame.mixer.music
tmix=pygame.mixer tmix=pygame.mixer
data=0 data=0
v=0.5 v=0.5
click=0
SS=0
pygame.init() # 初始化 pygame.init() # 初始化
# 创建窗口 # 创建窗口
screen = pygame.display.set_mode((640, 480)) screen = pygame.display.set_mode((640, 480))
...@@ -20,6 +22,14 @@ while True: ...@@ -20,6 +22,14 @@ 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.MOUSEBUTTONDOWN:
click+=1
if click%2==0:
mix.unpause()
SS=0
else:
mix.pause()
SS=1
if event.type==locals.KEYDOWN: if event.type==locals.KEYDOWN:
if event.key==locals.K_w: if event.key==locals.K_w:
v+=0.1 v+=0.1
...@@ -31,12 +41,15 @@ while True: ...@@ -31,12 +41,15 @@ while True:
v=0 v=0
# if event.key==locals.K_d: # if event.key==locals.K_d:
# if data <=3: # if data <=3:
# data+=1 # data+=1pause
# if event.key==locals.K_a: # if event.key==locals.K_a:
# if data >=0: # if data >=0:
# data-=1 # data-=1
screen.blit(bg_img, (0, 0)) # 填充背景 screen.blit(bg_img, (0, 0))
screen.blit(stop_img, (270, 330)) # 暂停按钮 if SS==0:
screen.blit(stop_img, (270, 330))
else:
screen.blit(play_img, (270, 330)) # 暂停按钮
screen.blit(logo_img, (170, 60)) # 中间logo图 screen.blit(logo_img, (170, 60)) # 中间logo图
screen.blit(last_img, (120, 350)) # 上一曲 screen.blit(last_img, (120, 350)) # 上一曲
screen.blit(next_img, (420, 350)) # 下一曲 screen.blit(next_img, (420, 350)) # 下一曲
......
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