Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Administrator
/
pygame_lesson04_diy
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
b95a8971
authored
Dec 04, 2021
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
6f4ea99b
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
38 additions
and
4 deletions
1.py/1.py
1.py/2.py
1.py/3.py
my_music.py
1.py/1.py
0 → 100644
View file @
b95a8971
a
=
int
(
input
(
"s,s="
))
b
=
int
(
input
(
"e,s="
))
c
=
a
-
b
h
=
int
(
c
/
3600
)
min
=
int
((
c
-
3600
*
h
)
/
60
)
s
=
int
(
c
-
3600
*
h
-
60
*
min
)
print
(
h
,
min
,
s
)
\ No newline at end of file
1.py/2.py
0 → 100644
View file @
b95a8971
import
turtle
a
=
turtle
.
Pen
()
a
.
fillcolor
(
"yellow"
)
a
.
begin_fill
()
a
.
circle
(
-
100
,
720
,
steps
=
5
)
a
.
end_fill
()
a
.
penup
()
a
.
goto
(
0
,
-
138
)
a
.
fillcolor
(
"red"
)
a
.
begin_fill
()
a
.
circle
(
38
,
360
,
steps
=
5
)
a
.
end_fill
()
turtle
.
done
()
\ No newline at end of file
1.py/3.py
0 → 100644
View file @
b95a8971
my_music.py
View file @
b95a8971
...
...
@@ -12,10 +12,17 @@ last_img = pygame.image.load('last.png') # 上一曲按钮
next_img
=
pygame
.
image
.
load
(
'next.png'
)
# 下一曲按钮
logo_img
=
pygame
.
image
.
load
(
'logo.png'
)
# 中间logo
FPS
=
pygame
.
time
.
Clock
()
pygame
.
mixer
.
music
.
load
(
"歌曲1.wav"
)
volume
=
0.0
volume
=
0.4
click
=
0
oe
=
logo_img
pygame
.
mixer
.
music
.
set_volume
(
volume
)
while
True
:
for
event
in
pygame
.
event
.
get
():
...
...
@@ -30,6 +37,12 @@ while True:
pygame
.
mixer
.
music
.
set_volume
(
volume
)
if
pygame
.
mixer
.
music
.
get_busy
()
==
False
:
pygame
.
mixer
.
music
.
play
()
if
event
.
type
==
locals
.
MOUSEBUTTONDOWN
:
click
+=
1
if
click
%
2
==
0
:
pygame
.
mixer
.
music
.
unpause
()
if
click
%
2
==
1
:
pygame
.
mixer
.
music
.
pause
()
# 绘制画面
screen
.
blit
(
bg_img
,
(
0
,
0
))
# 填充背景
screen
.
blit
(
stop_img
,
(
270
,
330
))
# 暂停按钮
...
...
@@ -38,4 +51,3 @@ while True:
screen
.
blit
(
next_img
,
(
420
,
350
))
# 下一曲
# 刷新画面
pygame
.
display
.
update
()
FPS
.
tick
(
3
)
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