Commit f45086cd by BellCodeEditor

save project

parent 06af53b1
Showing with 7 additions and 6 deletions
import pygame import pygame
from pygame import locals from pygame import locals
import os import os
pygame.init() # 初始化 pygame.init() # 初始化
# 创建窗口 # 创建窗口
screen = pygame.display.set_mode((640, 480)) screen = pygame.display.set_mode((640, 480))
...@@ -13,7 +12,6 @@ last_img = pygame.image.load('last.png') # 上一曲按钮 ...@@ -13,7 +12,6 @@ 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_img = pygame.image.load('logo.png') # 下一曲按钮
# 音乐
music_list = [] music_list = []
path = "C:\\Users\\bellcode\\Desktop\\test" path = "C:\\Users\\bellcode\\Desktop\\test"
filelist = os.listdir(path) filelist = os.listdir(path)
...@@ -71,12 +69,16 @@ while True: ...@@ -71,12 +69,16 @@ while True:
print(num) print(num)
pygame.mixer.music.load(path + "\\"+music_list[num]) pygame.mixer.music.load(path + "\\"+music_list[num])
pygame.mixer.music.play() pygame.mixer.music.play()
new_logo = pygame.transform.rotate(logo_img,angle)\
newrect = new_logo.get_busy(center=(320,200))
pos = (newrect[0],newrect[1])
if play_button ==stop_img
angle += 1
# 绘制画面 # 绘制画面
screen.blit(bg_img, (0, 0)) # 填充背景 screen.blit(bg_img, (0, 0)) # 填充背景
screen.blit(play_button, (270, 330)) # 暂停按钮 screen.blit(play_button, (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)) # 下一曲
# 刷新画面 pygame.display.update()
pygame.display.update()
\ No newline at end of file
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