Commit b802a166 by BellCodeEditor

save project

parent 8e02d524
Showing with 11 additions and 4 deletions
import pygame
import os
from pygame import locals
FPS=pygame.time.Clock()
pygame.init() # 初始化
# 创建窗口
screen = pygame.display.set_mode((640, 480))
......@@ -58,14 +58,17 @@ while True:
else:
play_button = play_img
pygame.mixer.music.pause()
if x>120 and x<220 and y>350 and y<400:
list_num-=1
if list_num<0:
list_num=len(music_list)-1
pygame.mixer.music.load(path_+"\\"+music_list[list_num])
pygame.mixer.music.play()
click=0
#click=0
play_button=stop_img
if x>420 and x<520 and y>350 and y<400:
list_num+=1
......@@ -87,8 +90,10 @@ while True:
new_logo = pygame.transform.rotate(logo_img, angle)
newRect = new_logo.get_rect(center=(320,200))
pos=(newRect[0], newRect[1])
angle +=1
if play_button==stop_img:
angle +=1
# 绘制画面
screen.blit(bg_img, (0, 0)) # 填充背景
screen.blit(play_button, (270, 330)) # 暂停按钮
......@@ -97,4 +102,6 @@ while True:
screen.blit(next_img, (420, 350)) # 下一曲
# 刷新画面
pygame.display.update()
FPS.tick(70)
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