Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Administrator
/
pygame_lesson6_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
9102993f
authored
May 17, 2025
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
349f0c91
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
186 additions
and
5 deletions
cdjnfm.py
hj.py
my_music.py
cdjnfm.py
0 → 100644
View file @
9102993f
import
pygame
from
pygame
import
locals
pygame
.
init
()
score
=
0
grid_size
=
0
grid_num_width
=
15
grid_num_height
=
25
FPS
=
30
screen
=
pygame
.
display
.
set_mode
((
460
,
500
))
pygame
.
display
.
set_caption
(
'老师万岁'
)
clock
=
pygame
.
time
..
Clock
()
background
=
pygame
.
image
.
load
()
font
=
pygame
.
font
.
Font
(
'STKAII.TTF'
,
60
)
while
True
:
for
event
in
pygame
.
event
.
get
():
if
event
.
type
==
locals
.
QUIT
:
exit
()
screen
.
blit
(
background
,(
0
,
0
))
score_text
=
font
.
render
(
str
(
score
),
True
,(
0
,
0
,
0
))
screen
.
blit
(
score_text
,(
350
,
70
))
pygame
.
display
.
urgent
()
clock
.
tick
(
FPS
)
hj.py
0 → 100644
View file @
9102993f
s
=
s
print
(
s
)
\ No newline at end of file
my_music.py
View file @
9102993f
...
...
@@ -14,7 +14,7 @@ next_img = pygame.image.load('next.png') # 下一曲按钮
logo_img
=
pygame
.
image
.
load
(
'logo.png'
)
# 下一曲按钮
music_list
=
[]
path
=
"C:
\\
Users
\\
Administrator
\\
Desktop
\\
tast"
path
=
os
.
path
.
join
(
"C:
\\
Users
\\
777
\\
Desktop
\\
mi"
)
filelist
=
os
.
listdir
(
path
)
num
=
-
1
for
i
in
filelist
:
...
...
@@ -81,9 +81,11 @@ while True:
num
+=
1
if
num
>
len
(
music_list
)
-
1
:
num
=
0
pygame
.
mixer
.
music
.
load
(
path
+
"
\\
"
+
music_list
[
num
]
)
pygame
.
mixer
.
music
.
load
(
os
.
path
.
join
(
path
,
music_list
[
num
])
)
pygame
.
mixer
.
music
.
play
()
new_logo
=
pygame
.
transform
.
rotate
(
logo_img
,
angle
)
new_logo
=
pygame
.
transform
.
notate
(
logo_img
,
angle
)
newRect
=
new_logo
.
get_rect
(
center
=
(
320
,
200
))
pos
=
(
newRect
[
0
],
newRect
[
1
])
angle
+=
1
screen
.
blit
(
bg_img
,
(
0
,
0
))
screen
.
blit
(
play_button
,
(
270
,
330
))
...
...
@@ -91,4 +93,5 @@ while True:
screen
.
blit
(
last_img
,
(
120
,
350
))
screen
.
blit
(
next_img
,
(
420
,
350
))
pygame
.
display
.
update
()
\ No newline at end of file
pygame
.
display
.
update
()
FPS
.
tick
(
60
)
\ No newline at end of file
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