Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Administrator
/
pygame_lesson5_diy1
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
f114335c
authored
Dec 03, 2022
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
1754f9f4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
2 deletions
ddd.png
my_music.py
ddd.png
0 → 100644
View file @
f114335c
我把ak放下拿起加特林
端起扫射扫穿了他的筋
三押战神我只有十三岁
没有义气的他嘴依然碎
拿起mic以为自己马思唯
这种flow我见过在垃圾堆
年轻又有力我才初中生
懂得客观不像你不忠诚
想成为rap star王以钛
你不付出努力只光期待
我在听着kanye你们却在拜韩国
你们格局小了才会觉得他在传说
\ No newline at end of file
my_music.py
View file @
f114335c
...
...
@@ -14,6 +14,7 @@ logo_img = pygame.image.load('logo.png') # 下一曲按钮
# 载入音乐
pygame
.
mixer
.
music
.
load
(
'歌曲4.ogg'
)
# 载入音乐
num
=
-
1
volume
=
0.2
pygame
.
mixer
.
music
.
set_volume
(
volume
)
# 初始播放音量
...
...
@@ -39,8 +40,10 @@ while True:
# 按下鼠标
if
event
.
type
==
locals
.
MOUSEBUTTONDOWN
:
# 次数增加
click
+=
1
if
event
.
button
==
1
:
x
,
y
=
event
.
pos
if
x
>
270
and
x
<
350
and
y
>
350
and
y
<
450
:
click
+=
1
if
click
%
2
==
0
:
play_button
=
stop_img
pygame
.
mixer
.
music
.
unpause
()
...
...
@@ -49,7 +52,13 @@ while True:
pygame
.
mixer
.
music
.
pause
()
if
pygame
.
mixer
.
music
.
get_busy
()
==
False
:
num
+=
1
if
num
>
len
(
filelist
)
-
1
:
num
=
0
pygame
.
mixer
.
music
.
load
(
filelist
[
num
])
pygame
.
mixer
.
music
.
play
()
# 绘制画面
screen
.
blit
(
bg_img
,
(
0
,
0
))
# 填充背景
...
...
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