Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Administrator
/
pygame_lesson7_diy3
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
f206dd92
authored
Sep 09, 2022
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
2a488058
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
46 additions
and
61 deletions
my_game.py
my_music.py
古法警队c.py
my_game.py
View file @
f206dd92
...
...
@@ -17,7 +17,6 @@ wukong = hero[0]
index
=
0
zhuangtai
=
"run"
y
=
400
t
=
30
while
True
:
for
event
in
pygame
.
event
.
get
():
if
event
.
type
==
locals
.
QUIT
:
...
...
@@ -32,20 +31,15 @@ while True:
wukong
=
hero
[
index
%
5
]
index
+=
1
if
zhuangtai
==
"up"
:
# if :
if
t
>
0
and
y
>
150
:
y
-=
t
t
-=
2
if
y
>
150
:
y
-=
5
else
:
zhuangtai
=
"down"
if
zhuangtai
==
"down"
:
# if :
if
t
<
30
and
y
<
400
:
y
+=
t
t
+=
2
if
y
<
400
:
y
+=
5
else
:
zhuangtai
=
"run"
t
=
30
# 将背景图画上去
screen
.
blit
(
background
,
(
0
,
0
))
...
...
my_music.py
View file @
f206dd92
...
...
@@ -5,7 +5,6 @@ import os
pygame
.
init
()
# 初始化
# 创建窗口
screen
=
pygame
.
display
.
set_mode
((
640
,
480
))
pygame
.
display
.
set_caption
(
"音乐播放器"
)
# 载入图片、资源
bg_img
=
pygame
.
image
.
load
(
'background.png'
)
# 背景图
play_img
=
pygame
.
image
.
load
(
'play.png'
)
# 播放按钮
...
...
@@ -15,7 +14,7 @@ next_img = pygame.image.load('next.png') # 下一曲按钮
logo_img
=
pygame
.
image
.
load
(
'logo.png'
)
# 下一曲按钮
myfont
=
pygame
.
font
.
Font
(
'neuropol.ttf'
,
15
)
music_list
=
[]
path
=
"C:
\\
Users
\\
Administrator
\\
Desktop
\
\
新建文件夹 (2)"
path
=
r"C:\Users\Administrator\Desktop
\新建文件夹 (2)"
filelist
=
os
.
listdir
(
path
)
num
=
-
1
for
i
in
filelist
:
...
...
古法警队c.py
View file @
f206dd92
b_temp
=
0
# banjing = int(input("输入半径:"))
b_temp
=
0
l_temp
=
[]
mo
=
[]
da
=
[]
result
=
""
a
=
input
(
"输入年月日:"
)
a
=
list
(
a
)
jq1
=
[
2.4
,
2.19
,
3.5
,
3.20
,
4.4
,
5.5
,
5.20
,
6.5
,
6.21
,
7.6
,
8.7
,
8.22
,
9.7
,
9.22
,
10.8
,
11.7
,
11.22
,
12.7
,
12.21
,
1.5
]
jq2
=
[
'LC'
,
'YS'
,
'JZ'
,
'CF'
,
'QM'
,
'LX'
,
'XM'
,
'MZ'
,
'XZ'
,
'XS'
,
'LQ'
,
'CS'
,
'BL'
,
'QF'
,
'HL'
,
'LD'
,
'XX'
,
'DX'
,
'DZ'
,
'XH'
]
months1
=
[
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
]
months2
=
[
10
,
11
,
12
]
days1
=
[
4
,
5
,
6
,
7
,
8
]
days2
=
[
19
,
20
,
21
,
22
]
while
result
==
""
:
if
a
[
5
]
==
"0"
:
mo
=
a
[
6
]
else
:
mo
=
a
[
5
:
7
]
if
a
[
8
]
==
"0"
:
da
=
a
[
9
]
else
:
da
=
a
[
8
:
10
]
if
len
(
mo
)
==
1
:
for
i
in
months1
:
if
mo
[
0
]
==
str
(
i
):
mo
[
0
]
=
i
else
:
for
i
in
months2
:
if
mo
[
0
]
==
str
(
i
):
mo
[
0
]
=
i
if
mo
[
1
]
==
str
(
i
):
mo
[
1
]
=
i
if
len
(
da
)
==
1
:
for
i
in
days1
:
if
da
[
0
]
==
str
(
i
):
da
[
0
]
=
i
else
:
for
i
in
days2
:
if
da
[
0
]
==
str
(
i
):
da
[
0
]
=
i
if
da
[
1
]
==
str
(
i
):
da
[
1
]
=
i
mo
=
""
.
join
(
mo
)
da
=
""
.
join
(
da
)
mo
.
da
=
mo
+
"."
+
da
mo
.
da
=
int
(
mo
.
da
)
# for i in jq1:
print
(
mo
.
da
)
# banjing = int(input("输入半径:"))
# zhijing = banjing * 2
# zhouchang = zhijing * 3.14
# mianji = 3.14 * banjing **2
# print("直径",zhijing,"周长",zhouchang,"面积",mianji)
import
turtle
pen
=
turtle
.
Pen
()
# pen.speed(0)
pen
.
penup
()
pen
.
goto
(
0
,
-
200
)
pen
.
pendown
()
pen
.
circle
(
200
)
pen
.
penup
()
pen
.
goto
(
-
100
,
50
)
pen
.
pendown
()
pen
.
fillcolor
(
"blue"
)
pen
.
begin_fill
()
pen
.
circle
(
20
)
pen
.
end_fill
()
pen
.
penup
()
pen
.
goto
(
100
,
50
)
pen
.
pendown
()
pen
.
begin_fill
()
pen
.
circle
(
20
)
pen
.
end_fill
()
pen
.
penup
()
pen
.
goto
(
0
,
50
)
pen
.
pendown
()
pen
.
begin_fill
()
pen
.
circle
(
-
50
,
steps
=
3
)
pen
.
end_fill
()
pen
.
penup
()
pen
.
goto
(
-
150
,
-
70
)
pen
.
pendown
()
pen
.
goto
(
0
,
-
170
)
pen
.
goto
(
150
,
-
70
)
turtle
.
done
()
\ 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