Commit 3b69c146 by BellCodeEditor

save project

parent 6be758bc
Showing with 21 additions and 5 deletions
...@@ -11,22 +11,38 @@ stop_img = pygame.image.load('stop.png') # 暂停按钮 ...@@ -11,22 +11,38 @@ stop_img = pygame.image.load('stop.png') # 暂停按钮
last_img = pygame.image.load('last.png') # 上一曲按钮 last_img = pygame.image.load('last.png') # 上一曲按钮
next_img = pygame.image.load('next.png') # 下一曲按钮 next_img = pygame.image.load('next.png') # 下一曲按钮
logo_img = pygame.image.load('logo.png') # 中间logo logo_img = pygame.image.load('logo.png') # 中间logo
pygame.mixer.music.load('test.wav') pygame.mixer.music.load('test.wav')
v = 0.8 v = 0.8
pygame.mixer.music.set_volume(v) pygame.mixer.music.set_volume(v)
asdfgh = 0
qwerty = stop_img
while True: 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()
elif event.type == locals.KEYDOWN: elif event.type == locals.KEYDOWN:
if event.key == locals.K_UP: if event.key == locals.K_UP:
v += 0.1 if v == 1:
v = 1
else:
v += 0.1
pygame.mixer.music.set_volume(v) pygame.mixer.music.set_volume(v)
elif event.key == locals.K_DOWN: elif event.key == locals.K_DOWN:
v -= 0.1 if v == 0:
pygame.mixer.music.set_volume(v) v = 0.1
else:
v -= 0.1
pygame.mixer.music.set_volume(v)
elif event.type == locals.MOUSEBUTTONDOWN:
asdfgh += 1
if asdfgh % 2 == 1:
pygame.mixer.music.pause()
qwerty = play_img
else:
pygame.mixer.music.unpause()
qwerty = stop_img
if pygame.mixer.music.get_busy() == 1: if pygame.mixer.music.get_busy() == 1:
pass pass
else: else:
...@@ -34,7 +50,7 @@ while True: ...@@ -34,7 +50,7 @@ while True:
# 绘制画面 # 绘制画面
screen.blit(bg_img, (0, 0)) # 填充背景 screen.blit(bg_img, (0, 0)) # 填充背景
screen.blit(stop_img, (270, 330)) # 暂停按钮 screen.blit(qwerty, (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