Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Administrator
/
pygame_lesson5_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
55d3375f
authored
Apr 03, 2021
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
0bd88b21
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
10 deletions
ddd.py
ddd.py
View file @
55d3375f
...
@@ -56,7 +56,7 @@ while True:
...
@@ -56,7 +56,7 @@ while True:
else
:
else
:
play_button
=
play_img
play_button
=
play_img
pygame
.
mixer
.
music
.
pause
()
pygame
.
mixer
.
music
.
pause
()
if
x
>
120
and
x
<
220
and
y
>
350
and
y
<
400
:
# 上一首
if
x
>
120
and
x
<
220
and
y
>
350
and
y
<
400
:
# 上一首
number
-=
1
number
-=
1
if
number
<
0
:
if
number
<
0
:
...
@@ -66,25 +66,45 @@ while True:
...
@@ -66,25 +66,45 @@ while True:
play_button
=
stop_img
play_button
=
stop_img
pygame
.
mixer
.
music
.
unpause
()
pygame
.
mixer
.
music
.
unpause
()
click
=
0
click
=
0
music1
=
pygame
.
mixer
.
Sound
(
path
+
"//"
+
music_list
[
number
])
length
=
int
(
music1
.
get_length
())
if
x
>
420
and
x
<
520
and
y
>
350
and
y
<
400
:
# 下一首
if
x
>
420
and
x
<
520
and
y
>
350
and
y
<
400
:
# 下一首
number
+=
1
number
+=
1
if
number
>
len
(
music_list
)
-
1
:
if
number
>
len
(
music_list
)
-
1
:
number
=
0
number
=
0
pygame
.
mixer
.
music
.
load
(
path
+
"//"
+
music_list
[
number
])
pygame
.
mixer
.
music
.
load
(
path
+
"//"
+
music_list
[
number
])
pygame
.
mixer
.
music
.
play
()
pygame
.
mixer
.
music
.
play
()
play_button
=
stop_img
play_button
=
stop_img
pygame
.
mixer
.
music
.
unpause
()
pygame
.
mixer
.
music
.
unpause
()
click
=
0
click
=
0
music1
=
pygame
.
mixer
.
Sound
(
path
+
"//"
+
music_list
[
number
])
length
=
int
(
music1
.
get_length
())
if
pygame
.
mixer
.
music
.
get_busy
()
==
False
:
# 循环播放
if
pygame
.
mixer
.
music
.
get_busy
()
==
False
:
# 循环播放
if
number
>
len
(
music_list
)
-
1
:
if
number
>
len
(
music_list
)
-
1
:
number
=
0
number
=
0
pygame
.
mixer
.
music
.
load
(
music_list
[
number
])
pygame
.
mixer
.
music
.
load
(
music_list
[
number
])
pygame
.
mixer
.
music
.
play
()
# 绘制画面
pygame
.
mixer
.
music
.
play
()
# 绘制画面
music1
=
pygame
.
mixer
.
Sound
(
path
+
"//"
+
music_list
[
number
])
length
=
int
(
music1
.
get_length
())
play_time
=
pygame
.
mixer
.
music
.
get_pos
()
play_time
=
pygame
.
mixer
.
music
.
get_pos
()
play_time
=
int
(
play_time
/
1000
)
play_time
=
int
(
play_time
/
1000
)
play_minute
=
play_time
//
60
play_minute
=
play_time
//
60
play_second
=
play_time
%
60
play_second
=
play_time
%
60
sofo
=
str
(
play_minute
)
+
":"
+
str
(
play_second
)
time_minute
=
length
//
60
time_second
=
length
%
60
if
time_minute
<
10
:
sofo2
=
"/"
+
" "
+
"0"
+
str
(
time_minute
)
+
":"
+
str
(
time_second
)
if
time_second
<
10
:
sofo2
=
"/"
+
" "
+
"0"
+
str
(
time_minute
)
+
":"
+
"0"
+
str
(
time_second
)
if
play_minute
<
10
:
sofo
=
"0"
+
str
(
play_minute
)
+
":"
+
str
(
play_second
)
if
play_second
<
10
:
sofo
=
"0"
+
str
(
play_minute
)
+
":"
+
"0"
+
str
(
play_second
)
logodown_img
=
pygame
.
transform
.
rotate
(
logo_img
,
xuanzhuan
)
# 页面
logodown_img
=
pygame
.
transform
.
rotate
(
logo_img
,
xuanzhuan
)
# 页面
if
play_button
==
stop_img
:
if
play_button
==
stop_img
:
xuanzhuan
+=
1
xuanzhuan
+=
1
...
@@ -97,5 +117,7 @@ while True:
...
@@ -97,5 +117,7 @@ while True:
screen
.
blit
(
next_img
,
(
420
,
350
))
# 下一曲
screen
.
blit
(
next_img
,
(
420
,
350
))
# 下一曲
screen
.
blit
(
logodown_img
,
(
pos
))
# 中间logo图
screen
.
blit
(
logodown_img
,
(
pos
))
# 中间logo图
t
=
sss
.
render
(
sofo
,
True
,(
0
,
0
,
0
))
t
=
sss
.
render
(
sofo
,
True
,(
0
,
0
,
0
))
tt
=
sss
.
render
(
sofo2
,
True
,(
0
,
0
,
0
))
screen
.
blit
(
t
,(
120
,
440
))
screen
.
blit
(
t
,(
120
,
440
))
screen
.
blit
(
tt
,(
210
,
440
))
pygame
.
display
.
update
()
# 刷新画面
pygame
.
display
.
update
()
# 刷新画面
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