Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Administrator
/
pygame_lesson5_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
0a18c99c
authored
Sep 18, 2022
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
6769ed72
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
15 deletions
my_music.py
my_music.py
View file @
0a18c99c
...
...
@@ -26,16 +26,6 @@ while True:
exit
()
# 按键,控制声音大小
if
event
.
type
==
locals
.
KEYDOWN
:
if
event
.
button
==
1
:
x
,
y
==
event
.
pos
if
x
<
370
and
x
>
270
and
y
<
450
and
y
>
350
:
click
+=
1
if
click
%
2
==
0
:
play_button
=
stop_img
pygame
.
mixer
.
music
.
unpause
else
:
play_button
=
play_img
pygame
.
mixer
.
music
.
pause
if
event
.
key
==
locals
.
K_UP
:
volume
+=
0.1
if
volume
>
1
:
...
...
@@ -50,11 +40,13 @@ while True:
# 按下鼠标
if
event
.
type
==
locals
.
MOUSEBUTTONDOWN
:
# 次数增加
click
+=
1
if
click
%
2
==
0
:
play_button
=
stop_img
pygame
.
mixer
.
music
.
unpause
()
if
event
.
button
==
1
:
x
,
y
=
event
.
pos
if
x
<
370
and
x
>
270
and
y
<
450
and
y
>
350
:
click
+=
1
if
click
%
2
==
0
:
play_button
=
stop_img
pygame
.
mixer
.
music
.
unpause
()
else
:
play_button
=
play_img
pygame
.
mixer
.
music
.
pause
()
...
...
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