Commit a5560ba9 by BellCodeEditor

save project

parent 03e7923e
Showing with 16 additions and 8 deletions
File added
...@@ -13,21 +13,17 @@ last_img = pygame.image.load('last.png') # 上一曲按钮 ...@@ -13,21 +13,17 @@ 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图
basic_font = pygame.font.Font('neuropol.ttf', 14) # 字体 basic_font = pygame.font.Font('neuropol.ttf', 14) # 字体
b_font = pygame.font.Font('SIMFANG.TTF', 40)
music_list = [] music_list = []
path = r"G:\level3-lesson6-diy2\music" path = "G:\\level3-lesson6-diy2\\music"
filelist = os.listdir(path) music_list = os.listdir(path)
for i in filelist: f = os.listdir(path)
if i[-4:] == ".ogg" or i[-4:] == ".wav":
music_list.append(i)
num = -1 num = -1
volume = 0.2 volume = 0.2
pygame.mixer.music.set_volume(volume) # 音乐播放器音量 pygame.mixer.music.set_volume(volume) # 音乐播放器音量
click = 0 # 初始点击次数 click = 0 # 初始点击次数
play_button = stop_img play_button = stop_img
angle = 0 angle = 0
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:
...@@ -125,5 +121,7 @@ while True: ...@@ -125,5 +121,7 @@ while True:
screen.blit(scoreSurf, (120,440)) screen.blit(scoreSurf, (120,440))
scoreSurf2 = basic_font.render("/" + info2, True, (0, 0, 0)) scoreSurf2 = basic_font.render("/" + info2, True, (0, 0, 0))
screen.blit(scoreSurf2, (170,440)) screen.blit(scoreSurf2, (170,440))
ssss = b_font.render(f[num], True, (0, 0, 0))
screen.blit(ssss,(226,15))
# 刷新画面 # 刷新画面
pygame.display.update() pygame.display.update()
\ No newline at end of file
import pygame
import os
filelist = os.listdir(r'G:\level3-lesson6-diy2\music')
music_list = []
for i in filelist:
if i[-4:] == ".ogg" or i[-4:] == ".wav" or i[-5] == '.flac' or i[-4] == '.mp3':
music_list.append(i)
f = os.listdir(r'G:\level3-lesson6-diy2\music')
\ 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