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
e77a697d
authored
a year ago
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
0d929f8c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
4 deletions
my_music.py
my_music.py
View file @
e77a697d
...
@@ -64,7 +64,9 @@ while True:
...
@@ -64,7 +64,9 @@ while True:
click
+=
2
click
+=
2
else
:
else
:
click
+=
1
click
+=
1
music1
=
pygame
.
mixer
.
sound
(
path
+
"
\\
"
+
music
[
num
])
music_length
=
music1
.
get_length
()
music_length
=
int
(
music_length
)
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
:
...
@@ -76,7 +78,9 @@ while True:
...
@@ -76,7 +78,9 @@ while True:
click
+=
2
click
+=
2
else
:
else
:
click
+=
1
click
+=
1
music1
=
pygame
.
mixer
.
sound
(
path
+
"
\\
"
+
music
[
num
])
music_length
=
music1
.
get_length
()
music_length
=
int
(
music_length
)
if
pygame
.
mixer
.
music
.
get_busy
()
==
False
:
if
pygame
.
mixer
.
music
.
get_busy
()
==
False
:
num
+=
1
num
+=
1
if
num
>
len
(
music_list
)
-
1
:
if
num
>
len
(
music_list
)
-
1
:
...
@@ -87,7 +91,17 @@ while True:
...
@@ -87,7 +91,17 @@ while True:
play_time
=
int
(
play_time
/
1000
)
play_time
=
int
(
play_time
/
1000
)
p_z
=
p
//
60
p_z
=
p
//
60
p_y
=
p
%
60
p_y
=
p
%
60
p_a
=
str
(
p_z
)
+
":"
+
str
(
p_y
)
if
p_y
<
10
:
p_y
=
"0"
+
str
(
p_y
)
info
=
str
(
p_z
)
+
":"
+
str
(
p_y
)
p_m
=
p
//
60
p_s
=
p
%
60
if
p_s
<
10
:
p_s
=
"0"
+
str
(
p_s
)
info2
=
str
(
p_m
)
+
":"
+
str
(
p_s
)
music1
=
pygame
.
mixer
.
sound
(
path
+
"
\\
"
+
music
[
num
])
music_length
=
music1
.
get_length
()
music_length
=
int
(
music_length
)
new_logo
=
pygame
.
transform
.
rotate
(
logo_img
,
angle
)
new_logo
=
pygame
.
transform
.
rotate
(
logo_img
,
angle
)
newRect
=
new_logo
.
get_rect
(
center
=
(
320
,
200
))
newRect
=
new_logo
.
get_rect
(
center
=
(
320
,
200
))
pos
=
(
newRect
[
0
],
newRect
[
1
])
pos
=
(
newRect
[
0
],
newRect
[
1
])
...
@@ -98,6 +112,9 @@ while True:
...
@@ -98,6 +112,9 @@ while True:
screen
.
blit
(
new_logo
,
pos
)
screen
.
blit
(
new_logo
,
pos
)
screen
.
blit
(
last_img
,
(
120
,
350
))
screen
.
blit
(
last_img
,
(
120
,
350
))
screen
.
blit
(
next_img
,
(
420
,
350
))
screen
.
blit
(
next_img
,
(
420
,
350
))
scoreSurf
=
basic_font
.
render
(
info
,
True
,(
255
,
255
,
255
))
screen
.
blit
(
scoreSurf
,(
120
,
440
))
scoreSurf
=
basic_font
.
render
(
"/"
+
info2
,
True
,(
0
,
0
,
0
))
screen
.
blit
(
scoreSurf2
,(
170
,
440
))
pygame
.
display
.
update
()
pygame
.
display
.
update
()
play_time
play_time
\ 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