Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Administrator
/
pygame_lesson4_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
0e283b11
authored
2 years ago
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
691090f0
c73162l1367p256a14056/wx008603
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
3 deletions
frog.mp3
my_music.py
frog.mp3
deleted
100644 → 0
View file @
691090f0
File deleted
This diff is collapsed.
Click to expand it.
my_music.py
View file @
0e283b11
...
@@ -14,6 +14,7 @@ logo_img = pygame.image.load('logo.png') # 中间logo
...
@@ -14,6 +14,7 @@ logo_img = pygame.image.load('logo.png') # 中间logo
song
=
pygame
.
mixer
.
music
.
load
(
"frog.mp3"
)
song
=
pygame
.
mixer
.
music
.
load
(
"frog.mp3"
)
v
=
1.0
v
=
1.0
ans
=
0
ans
=
0
face
=
stop_img
pygame
.
mixer
.
music
.
set_volume
(
v
)
pygame
.
mixer
.
music
.
set_volume
(
v
)
while
True
:
while
True
:
for
event
in
pygame
.
event
.
get
():
for
event
in
pygame
.
event
.
get
():
...
@@ -30,16 +31,16 @@ while True:
...
@@ -30,16 +31,16 @@ while True:
if
event
.
type
==
locals
.
MOUSEBUTTONUP
:
if
event
.
type
==
locals
.
MOUSEBUTTONUP
:
ans
+=
1
ans
+=
1
if
ans
%
2
==
1
:
if
ans
%
2
==
1
:
screen
.
blit
(
play_img
,
(
270
,
330
))
face
=
play_img
pygame
.
mixer
.
music
.
pause
()
pygame
.
mixer
.
music
.
pause
()
else
:
else
:
screen
.
blit
(
stop_img
,
(
270
,
330
))
face
=
stop_img
pygame
.
mixer
.
music
.
unpause
()
pygame
.
mixer
.
music
.
unpause
()
# 绘制画面
# 绘制画面
screen
.
blit
(
bg_img
,
(
0
,
0
))
screen
.
blit
(
bg_img
,
(
0
,
0
))
screen
.
blit
(
logo_img
,
(
170
,
60
))
screen
.
blit
(
logo_img
,
(
170
,
60
))
screen
.
blit
(
stop_img
,
(
270
,
330
))
screen
.
blit
(
face
,
(
270
,
330
))
screen
.
blit
(
last_img
,
(
120
,
350
))
# 上一曲
screen
.
blit
(
last_img
,
(
120
,
350
))
# 上一曲
screen
.
blit
(
next_img
,
(
420
,
350
))
# 下一曲
screen
.
blit
(
next_img
,
(
420
,
350
))
# 下一曲
# 刷新画面
# 刷新画面
...
...
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