Commit 72fcb52e by BellCodeEditor

save project

parent 5c3920a4
Showing with 0 additions and 23 deletions
...@@ -2,8 +2,6 @@ import pygame ...@@ -2,8 +2,6 @@ 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))
...@@ -60,13 +58,7 @@ while True: ...@@ -60,13 +58,7 @@ while True:
if num > len(music_list) - 1: if num > len(music_list) - 1:
num = 0 num = 0
pygame.mixer.music.load(path + "\\" + music_list[num]) pygame.mixer.music.load(path + "\\" + music_list[num])
pygame.mixer.music.play() pygame.mixer.music.play()
music=pygame.mixer.Sound(path + "\\" + music_list[num])
music_lcugth=music.get_length()
music_length=int(music_legth)
play_button = stop_img play_button = stop_img
if click % 2 == 0: if click % 2 == 0:
click += 2 click += 2
...@@ -79,10 +71,6 @@ while True: ...@@ -79,10 +71,6 @@ while True:
num = len(music_list) - 1 num = len(music_list) - 1
pygame.mixer.music.load(path + "\\" + music_list[num]) pygame.mixer.music.load(path + "\\" + music_list[num])
pygame.mixer.music.play() pygame.mixer.music.play()
music=pygame.mixer.Sound(path + "\\" + music_list[num])
music_lcugth=music.get_length()
music_length=int(music_legth)
play_button = stop_img play_button = stop_img
if click % 2 == 0: if click % 2 == 0:
click += 2 click += 2
...@@ -95,9 +83,6 @@ while True: ...@@ -95,9 +83,6 @@ while True:
num = 0 num = 0
pygame.mixer.music.load(path + "\\" + music_list[num]) pygame.mixer.music.load(path + "\\" + music_list[num])
pygame.mixer.music.play() pygame.mixer.music.play()
music=pygame.mixer.Sound(path + "\\" + music_list[num])
music_lcugth=music.get_length()
music_length=int(music_legth)
if play_button==stop_img: if play_button==stop_img:
new_logo=pygame.tranform.rotate(logo_img,angle) new_logo=pygame.tranform.rotate(logo_img,angle)
...@@ -105,17 +90,10 @@ while True: ...@@ -105,17 +90,10 @@ while True:
pos=(rect[0],rect[1]) pos=(rect[0],rect[1])
angle=1 angle=1
# 绘制画面 # 绘制画面
music_m=music_length//60
music_s=music_longth%60
if music_s<10:
music_s="0"+str(music_s)
info1=str(music_m)+":"+str(music_s)
text1=my_font.render("/"+info1,True,(0,0,0))
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(new_logo, pos) # 中间logo图 screen.blit(new_logo, pos) # 中间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)) # 下一曲
screen.bite(text1,())
# 刷新画面 # 刷新画面
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