Commit 128a62a7 by BellCodeEditor

auto save

parent 1afa63ec
Showing with 1 additions and 23 deletions
import pygame
from pygame import locals
import os
import random
pygame.init() # 初始化
# 创建窗口
......@@ -27,7 +26,6 @@ click = 0
play_button = stop_img
angle=0
niyuchen=0
f2=pygame.font.Font("wula.ttc",50)
while True:
for event in pygame.event.get():
if event.type == locals.QUIT:
......@@ -87,9 +85,6 @@ while True:
click += 1
if niyuchen==0:
angle-=0.909
font=pygame.font.Font("wula.ttc",50)
else:
font=pygame.font.Font("wul.ttc",50)
newlogo=pygame.transform.rotate(logo_img,angle)
newrect=newlogo.get_rect(center=(320,200))
pos=(newrect[0],newrect[1])
......@@ -99,29 +94,13 @@ while True:
num = 0
pygame.mixer.music.load(path + "\\" + music_list[num])
pygame.mixer.music.play()
s=int(pygame.mixer.music.get_pos()//1000)
info=str(s//60)+":"+str(s%60)
print(info)
ypa=random.randint(1,12)
first=random.randint(0,20)
second=random.randint(0,20)
third=random.randint(0,20)
if niyuchen==0:
text = font.render(info,True,(first*ypa,second*ypa,third*ypa))
else:
text = font.render(info,True,(255,255,255))
t2 = font.render(info,False,(third*ypa,first*ypa,second*ypa))
# 绘制画面
screen.blit(bg_img, (0, 0)) # 填充背景
screen.blit(play_button, (270, 330)) # 暂停按钮
screen.blit(newlogo,pos) # 中间logo图
screen.blit(last_img, (120, 350)) # 上一曲
screen.blit(next_img, (420, 350)) # 下一曲
if niyuchen==0:
screen.blit(text,(ypa+20,ypa+400))
screen.blit(t2,(ypa+20-first,ypa+400-first))
else:
screen.blit(text,(25,400))
# 刷新画面
clock.tick(60)
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