Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Administrator
/
pygame_lesson6_diy3
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
813b6654
authored
4 years ago
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
a8337ea0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
0 deletions
my_music.py
my_music.py
View file @
813b6654
...
...
@@ -66,6 +66,9 @@ while True:
click
+=
2
else
:
click
+=
1
music1
=
pygame
.
mixer
.
Sound
(
path
+
"
\\
"
+
music_list
[
num
])
musiclength
=
music1
.
get_length
()
musiclength
=
int
(
musiclength
)
if
x
>
120
and
x
<
220
and
y
>
350
and
y
<
400
:
# 上一曲
num
-=
1
...
...
@@ -78,6 +81,9 @@ while True:
click
+=
2
else
:
click
+=
1
music1
=
pygame
.
mixer
.
Sound
(
path
+
"
\\
"
+
music_list
[
num
])
musiclength
=
music1
.
get_length
()
musiclength
=
int
(
musiclength
)
if
pygame
.
mixer
.
music
.
get_busy
()
==
False
:
num
+=
1
...
...
@@ -85,6 +91,10 @@ while True:
num
=
0
pygame
.
mixer
.
music
.
load
(
path
+
"
\\
"
+
music_list
[
num
])
pygame
.
mixer
.
music
.
play
()
music1
=
pygame
.
mixer
.
Sound
(
path
+
"
\\
"
+
music_list
[
num
])
musiclength
=
music1
.
get_length
()
musiclength
=
int
(
musiclength
)
newlogo
=
pygame
.
transform
.
rotate
(
logo_img
,
angle
)
newRect
=
newlogo
.
get_rect
(
center
=
(
320
,
200
))
...
...
@@ -98,6 +108,14 @@ while True:
plays
=
'0'
+
str
(
plays
)
info1
=
str
(
playm
)
+
':'
+
str
(
plays
)
text1
=
a
.
render
(
info1
,
True
,(
255
,
255
,
255
))
musicm
=
musiclength
//
60
musics
=
musiclength
%
60
if
musics
<
10
:
musics
=
'0'
+
str
(
musics
)
info2
=
'/'
+
str
(
musicm
)
+
':'
+
str
(
musics
)
text2
=
a
.
render
(
info2
,
True
,(
255
,
255
,
255
))
# 绘制画面
...
...
@@ -107,5 +125,6 @@ while True:
screen
.
blit
(
last_img
,
(
120
,
350
))
# 上一曲
screen
.
blit
(
next_img
,
(
420
,
350
))
# 下一曲
screen
.
blit
(
text1
,(
120
,
420
))
screen
.
blit
(
text2
,(
170
,
420
))
# 刷新画面
pygame
.
display
.
update
()
\ No newline at end of file
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