Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Administrator
/
pygame_lesson6_diy4
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
437eaa69
authored
3 years ago
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
6072872d
c157690l1384p256a14207/wx727515
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
7 deletions
my_music.py
my_music.py
View file @
437eaa69
#玛酷教务主管葡萄老师🍇:
import
pygame
from
pygame
import
locals
import
os
...
...
@@ -71,8 +70,9 @@ while True:
num
=
len
(
music_list
)
-
1
pygame
.
mixer
.
music
.
load
(
path
+
"
\\
"
+
music_list
[
num
])
pygame
.
mixer
.
music
.
play
()
pygame
.
mixer
.
Sound
(
path
+
"
\\
"
+
music_list
[
num
])
a
=
int
(
music
.
get_length
(
path
+
"
\\
"
+
music_list
[
num
]))
music1
=
pygame
.
mixer
.
Sound
(
path
+
"
\\
"
+
music_list
[
num
])
a
=
int
(
music1
.
get_length
())
music_q
=
a
//
60
music_e
=
a
%
60
if
int
(
music_e
)
<
10
:
...
...
@@ -88,7 +88,7 @@ while True:
pygame
.
mixer
.
music
.
load
(
path
+
"
\\
"
+
music_list
[
num
])
pygame
.
mixer
.
music
.
play
()
pygame
.
mixer
.
Sound
(
path
+
"
\\
"
+
music_list
[
num
])
a
=
int
(
music
.
get_length
(
path
+
"
\\
"
+
music_list
[
num
]
))
a
=
int
(
music
1
.
get_length
(
))
music_q
=
a
//
60
music_e
=
a
%
60
if
int
(
music_e
)
<
10
:
...
...
@@ -103,9 +103,10 @@ while True:
num
=
0
pygame
.
mixer
.
music
.
load
(
path
+
"
\\
"
+
music_list
[
num
])
pygame
.
mixer
.
music
.
play
()
# 播放音乐
pygame
.
mixer
.
Sound
(
path
+
"
\\
"
+
music_list
[
num
])
a
=
music
.
get_length
(
path
+
"
\\
"
+
music_list
[
num
]
)
music1
=
pygame
.
mixer
.
Sound
(
path
+
"
\\
"
+
music_list
[
num
])
a
=
music
1
.
get_length
(
)
a
=
int
(
a
)
music_q
=
a
//
60
music_e
=
a
%
60
if
int
(
music_e
)
<
10
:
...
...
@@ -138,7 +139,7 @@ while True:
# 绘制时间进度
scoreSurf
=
basic_font
.
render
(
info
,
True
,
(
255
,
255
,
255
))
screen
.
blit
(
scoreSurf
,
(
120
,
440
))
scoreSurf
=
basic_font
.
render
(
"/"
+
info2
,
True
,
(
255
,
255
,
255
))
scoreSurf
2
=
basic_font
.
render
(
"/"
+
info2
,
True
,
(
255
,
255
,
255
))
screen
.
blit
(
scoreSurf2
,
(
170
,
440
))
# 刷新画面
pygame
.
display
.
update
()
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment