Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Administrator
/
pygame_lesson6_diy2
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
9c61d861
authored
3 years ago
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
4e8ac9dc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
1 deletions
my_music.py
my_music.py
View file @
9c61d861
...
@@ -60,6 +60,9 @@ while True:
...
@@ -60,6 +60,9 @@ 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
])
music1_length
=
int
(
music1
.
get_length
())
print
(
music1_length
)
play_button
=
stop_img
play_button
=
stop_img
if
click
%
2
==
0
:
if
click
%
2
==
0
:
click
+=
2
click
+=
2
...
@@ -72,6 +75,9 @@ while True:
...
@@ -72,6 +75,9 @@ while True:
num
=
len
(
music_list
)
-
1
num
=
len
(
music_list
)
-
1
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
])
music1_length
=
int
(
music1
.
get_length
())
print
(
music1_length
)
play_button
=
stop_img
play_button
=
stop_img
if
click
%
2
==
0
:
if
click
%
2
==
0
:
click
+=
2
click
+=
2
...
@@ -84,6 +90,10 @@ while True:
...
@@ -84,6 +90,10 @@ 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
])
music1_length
=
int
(
music1
.
get_length
())
print
(
music1_length
)
new_logo
=
pygame
.
transform
.
rotate
(
logo_img
,
angle
)
new_logo
=
pygame
.
transform
.
rotate
(
logo_img
,
angle
)
new_rect
=
new_logo
.
get_rect
(
center
=
(
320
,
200
))
new_rect
=
new_logo
.
get_rect
(
center
=
(
320
,
200
))
...
@@ -94,7 +104,8 @@ while True:
...
@@ -94,7 +104,8 @@ while True:
play_time_sec
=
int
(
play_time
/
1000
)
play_time_sec
=
int
(
play_time
/
1000
)
play_m
=
play_time_sec
//
60
play_m
=
play_time_sec
//
60
play_s
=
play_time_sec
%
60
play_s
=
play_time_sec
%
60
print
(
"min: "
+
str
(
play_m
)
+
"Sec: "
+
str
(
play_s
))
# 绘制画面
# 绘制画面
screen
.
blit
(
bg_img
,
(
0
,
0
))
# 填充背景
screen
.
blit
(
bg_img
,
(
0
,
0
))
# 填充背景
screen
.
blit
(
play_button
,
(
270
,
330
))
# 暂停按钮
screen
.
blit
(
play_button
,
(
270
,
330
))
# 暂停按钮
...
...
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