Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Administrator
/
lesson14_1
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
37c272d8
authored
Feb 02, 2021
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
f47689a4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
239 additions
and
0 deletions
ddd.py
diy.py
ddd.py
0 → 100644
View file @
37c272d8
from
turtle
import
*
def
nose
(
x
,
y
):
"""画鼻子"""
penup
()
# 将海龟移动到指定的坐标
goto
(
x
,
y
)
pendown
()
# 设置海龟的方向(0-东、90-北、180-西、270-南)
setheading
(
-
30
)
begin_fill
()
a
=
0.4
for
i
in
range
(
120
):
if
0
<=
i
<
30
or
60
<=
i
<
90
:
a
=
a
+
0.08
# 向左转3度
left
(
3
)
# 向前走
forward
(
a
)
else
:
a
=
a
-
0.08
left
(
3
)
forward
(
a
)
end_fill
()
penup
()
setheading
(
90
)
forward
(
25
)
setheading
(
0
)
forward
(
10
)
pendown
()
# 设置画笔的颜色(红, 绿, 蓝)
pencolor
(
255
,
155
,
192
)
setheading
(
10
)
begin_fill
()
circle
(
5
)
color
(
160
,
82
,
45
)
end_fill
()
penup
()
setheading
(
0
)
forward
(
20
)
pendown
()
pencolor
(
255
,
155
,
192
)
setheading
(
10
)
begin_fill
()
circle
(
5
)
color
(
160
,
82
,
45
)
end_fill
()
def
head
(
x
,
y
):
"""画头"""
color
((
255
,
155
,
192
),
"pink"
)
penup
()
goto
(
x
,
y
)
setheading
(
0
)
pendown
()
begin_fill
()
setheading
(
180
)
circle
(
300
,
-
30
)
circle
(
100
,
-
60
)
circle
(
80
,
-
100
)
circle
(
150
,
-
20
)
circle
(
60
,
-
95
)
setheading
(
161
)
circle
(
-
300
,
15
)
penup
()
goto
(
-
100
,
100
)
pendown
()
setheading
(
-
30
)
a
=
0.4
for
i
in
range
(
60
):
if
0
<=
i
<
30
or
60
<=
i
<
90
:
a
=
a
+
0.08
lt
(
3
)
#向左转3度
fd
(
a
)
#向前走a的步长
else
:
a
=
a
-
0.08
lt
(
3
)
fd
(
a
)
end_fill
()
def
ears
(
x
,
y
):
"""画耳朵"""
color
((
255
,
155
,
192
),
"pink"
)
penup
()
goto
(
x
,
y
)
pendown
()
begin_fill
()
setheading
(
100
)
circle
(
-
50
,
50
)
circle
(
-
10
,
120
)
circle
(
-
50
,
54
)
end_fill
()
penup
()
setheading
(
90
)
forward
(
-
12
)
setheading
(
0
)
forward
(
30
)
pendown
()
begin_fill
()
setheading
(
100
)
circle
(
-
50
,
50
)
circle
(
-
10
,
120
)
circle
(
-
50
,
56
)
end_fill
()
def
eyes
(
x
,
y
):
"""画眼睛"""
color
((
255
,
155
,
192
),
"white"
)
penup
()
setheading
(
90
)
forward
(
-
20
)
setheading
(
0
)
forward
(
-
95
)
pendown
()
begin_fill
()
circle
(
15
)
end_fill
()
color
(
"black"
)
penup
()
setheading
(
90
)
forward
(
12
)
setheading
(
0
)
forward
(
-
3
)
pendown
()
begin_fill
()
circle
(
3
)
end_fill
()
color
((
255
,
155
,
192
),
"white"
)
penup
()
seth
(
90
)
forward
(
-
25
)
seth
(
0
)
forward
(
40
)
pendown
()
begin_fill
()
circle
(
15
)
end_fill
()
color
(
"black"
)
penup
()
setheading
(
90
)
forward
(
12
)
setheading
(
0
)
forward
(
-
3
)
pendown
()
begin_fill
()
circle
(
3
)
end_fill
()
def
cheek
(
x
,
y
):
"""画脸颊"""
color
((
255
,
155
,
192
))
penup
()
goto
(
x
,
y
)
pendown
()
setheading
(
0
)
begin_fill
()
circle
(
30
)
end_fill
()
def
mouth
(
x
,
y
):
"""画嘴巴"""
color
(
239
,
69
,
19
)
penup
()
goto
(
x
,
y
)
pendown
()
setheading
(
-
80
)
circle
(
30
,
40
)
circle
(
40
,
80
)
def
setting
():
"""设置参数"""
pensize
(
4
)
# 隐藏海龟
hideturtle
()
colormode
(
255
)
color
((
255
,
155
,
192
),
"pink"
)
setup
(
840
,
500
)
speed
(
10
)
def
main
():
"""主函数"""
setting
()
nose
(
-
100
,
100
)
head
(
-
69
,
167
)
ears
(
0
,
160
)
eyes
(
0
,
140
)
cheek
(
80
,
10
)
mouth
(
-
20
,
30
)
done
()
if
__name__
==
'__main__'
:
main
()
\ No newline at end of file
diy.py
View file @
37c272d8
亚
b
=
'圣光守护(每2秒恢复相当于自身1
%
的最大生命值)'
亚
1
=
'誓约之盾(3秒内提升30
%
移速并强化下次普攻,造成伤害和沉默,同时对标记目标,持续5秒,标记会造成伤害,并增加友军移速)'
亚
2
=
'回旋打击(召唤持续5秒圣盾对自身周围目标造成持续伤害)'
亚
3
=
'圣剑裁决(技能开启时使亚瑟向敌方英雄跳跃,造成目标最大生命值12
%
法术伤害和0.5秒击飞,在目标区域留下圣印持续5秒对敌人伤害)'
class
Hero
:
def
__init__
(
self
,
difficultdegree
,
hp
,
attack
,
passive
,
sillk1
,
sillk2
,
sillk3
):
self
.
difficultdegree
=
difficultdegree
self
.
hp
=
hp
self
.
attack
=
attack
self
.
passive
=
passive
self
.
sillk1
=
sillk1
self
.
sillk2
=
sillk2
self
.
sillk3
=
sillk3
z
=
input
(
'你想知道的属性是:'
)
亚瑟
=
Hero
(
1
,
3622
,
145
,
亚
b
,
亚
1
,
亚
2
,
亚
3
)
if
z
==
'易难度'
:
print
(
'亚瑟的'
+
z
+
'为:'
,
亚瑟
.
difficultdegree
)
if
z
==
'血量'
:
print
(
'亚瑟的'
+
z
+
'为:'
,
亚瑟
.
hp
)
if
z
==
'攻击'
:
print
(
'亚瑟的'
+
z
+
'为:'
,
亚瑟
.
attack
)
if
z
==
'被动'
:
print
(
'亚瑟的'
+
z
+
'为:'
,
亚瑟
.
passive
)
if
z
==
'一技能'
:
print
(
'亚瑟的'
+
z
+
'为:'
,
亚瑟
.
sillk1
)
if
z
==
'二技能'
:
print
(
'亚瑟的'
+
z
+
'为:'
,
亚瑟
.
sillk2
)
if
z
==
'三技能'
:
print
(
'亚瑟的'
+
z
+
'为:'
,
亚瑟
.
sillk3
)
def
uplevel
():
亚瑟
.
hp
=
亚瑟
.
hp
+
100
亚瑟
.
attack
=
亚瑟
.
attack
+
100
uplevel
()
uplevel
()
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