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
08abd000
authored
Dec 24, 2021
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
4ee61d67
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
11 deletions
my_music.py
了解.py
my_music.py
View file @
08abd000
...
@@ -69,6 +69,7 @@ while True:
...
@@ -69,6 +69,7 @@ while True:
else
:
else
:
click
+=
1
click
+=
1
if
x
>
120
and
x
<
220
and
y
>
350
and
y
<
400
:
# 上一曲
if
x
>
120
and
x
<
220
and
y
>
350
and
y
<
400
:
# 上一曲
num
-=
1
num
-=
1
if
num
<
0
:
if
num
<
0
:
...
@@ -79,16 +80,11 @@ while True:
...
@@ -79,16 +80,11 @@ while True:
if
click
%
2
==
0
:
if
click
%
2
==
0
:
click
+=
2
click
+=
2
else
:
else
:
click
+=
1
click
+=
1
play_time
=
pygame
.
mixer
.
music
.
get_pos
()
play_time
=
int
(
play_time
/
1000
)
play_m
=
play_time
//
60
play_s
=
play_time
%
60
info
=
str
(
play_m
)
+
':'
+
str
(
play_s
)
nb
=
play_time
if
pygame
.
mixer
.
music
.
get_busy
()
==
False
:
if
pygame
.
mixer
.
music
.
get_busy
()
==
False
:
...
@@ -97,6 +93,25 @@ while True:
...
@@ -97,6 +93,25 @@ while True:
num
=
0
num
=
0
pygame
.
mixer
.
music
.
load
(
path
+
"
\\
"
+
music_list
[
num
])
pygame
.
mixer
.
music
.
load
(
path
+
"
\\
"
+
music_list
[
num
])
pygame
.
mixer
.
music
.
play
()
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
)
nb
=
play_time
play_m
=
play_time
//
60
play_s
=
play_time
%
60
if
play_time
<
10
:
play_s
=
"0"
+
str
(
play_s
)
info
=
str
(
play_m
)
+
':'
+
str
(
play_s
)
music_m
=
music_length
//
60
music_s
=
music_length
%
60
if
music_s
<
10
:
music_s
=
"0"
+
music_s
info2
=
str
(
music_m
)
+
':'
+
str
(
music_s
)
# 绘制画面
# 绘制画面
if
play_button
==
stop_img
:
if
play_button
==
stop_img
:
...
@@ -113,6 +128,8 @@ while True:
...
@@ -113,6 +128,8 @@ while True:
screen
.
blit
(
next_img
,
(
420
,
350
))
# 下一曲
screen
.
blit
(
next_img
,
(
420
,
350
))
# 下一曲
scoreSurf
=
basic_font
.
render
(
info
,
True
,(
255
,
255
,
255
))
scoreSurf
=
basic_font
.
render
(
info
,
True
,(
255
,
255
,
255
))
screen
.
blit
(
scoreSurf
,(
120
,
440
))
screen
.
blit
(
scoreSurf
,(
120
,
440
))
scoreSurf2
=
basic_font
.
render
(
'/'
+
info2
,
True
,(
0
,
0
,
0
))
screen
.
blit
(
scoreSurf2
,(
170
,
440
))
# 刷新画面
# 刷新画面
pygame
.
display
.
update
()
pygame
.
display
.
update
()
\ No newline at end of file
了解.py
deleted
100644 → 0
View file @
4ee61d67
KK
=
{
'EE'
}
KK
=
{
'EE'
}
\ No newline at end of file
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