Commit 8d230829 by BellCodeEditor

save project

parent 323bc0fc
Showing with 22 additions and 0 deletions
import pygame
from pygame import locals
pygame.init()
screen = pygame.display.set_mode((420,540))
music1 = pygame.mixer.Sound('歌曲1.wav')
music2 = pygame.mixer.Sound('歌曲2.wav')
music1.play()
music2.play()
while True:
for event in pygame.event.get():
if event.type == locals.QUIT:
exit()
\ No newline at end of file
......@@ -65,6 +65,9 @@ while True:
click += 2
else:
click += 1
music1 = pygame.mixer.Sound(path + "\\" + music_list[num])
music_length = music1.get_length()
music_length = int(music_length)
if x > 120 and x < 220 and y > 350 and y < 400: # 上一曲
num -= 1
......@@ -77,6 +80,9 @@ while True:
click += 2
else:
click += 1
music1 = pygame.mixer.Sound(path + "\\" + music_list[num])
music_length = music1.get_length()
music_length = int(music_length)
if pygame.mixer.music.get_busy() == False:
num += 1
......@@ -84,6 +90,9 @@ while True:
num = 0
pygame.mixer.music.load(path + "\\" + music_list[num])
pygame.mixer.music.play()
music1 = pygame.mixer.Sound(path + "\\" + music_list[num])
music_length = music1.get_length()
music_length = int(music_length)
play_time = pygame.mixer.music.get_pos()
play_time = int(play_time/1000)
......
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