Commit 19448d98 by BellCodeEditor

save project

parent f694a0e1
Showing with 13 additions and 5 deletions
import pygame
from pygame import locals
import os
pygame.init() # 初始化
# 创建窗口
......@@ -11,9 +12,12 @@ stop_img = pygame.image.load('stop.png') # 暂停按钮
last_img = pygame.image.load('last.png') # 上一曲按钮
next_img = pygame.image.load('next.png') # 下一曲按钮
logo_img = pygame.image.load('logo.png') # 下一曲按钮
music=['歌曲4.ogg','歌曲3.wav','歌曲2.wav','歌曲1.wav']
music=[]
num=-1
i=os.listdir("C:\\Users\\ACER\\Desktop\\text")
music.append(i)
if i[-4:]==".ogg" or i[-4:]==".wav":
music.append(i)
# 载入音乐
# 载入音乐
......@@ -42,7 +46,7 @@ while True:
# 按下鼠标
music=['歌曲4.ogg','歌曲3.wav','歌曲2.wav','歌曲1.wav']
num=-1
if event.type == locals.MOUSEBUTTONDOWN:
if event.button==1:
x,y= event.pos
......@@ -71,4 +75,8 @@ while True:
screen.blit(last_img, (120, 350)) # 上一曲
screen.blit(next_img, (420, 350)) # 下一曲
# 刷新画面
pygame.display.update()
\ No newline at end of file
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