Commit 507936d7 by BellCodeEditor

auto save

parent 6f2012f5
Showing with 28 additions and 7 deletions
import turtle
pen=turtle.Pen()
screen=turtle.Screen()
pen.fillcolor("white")
pen.begin_fill()
pen.forward(200)
pen.left(90)
pen.forward(200)
pen.left(90)
pen.forward(200)
pen.left(90)
pen.forward(200)
pen.left(90)
pen.end_fill()
pen.hideturtle()
turtle.done()
\ No newline at end of file
...@@ -4,9 +4,13 @@ class Hero: ...@@ -4,9 +4,13 @@ class Hero:
self.name=name self.name=name
self.hp=hp self.hp=hp
self.attack=attack self.attack=attack
yase=Hero('yase',300,20) def upgrade():#升级
houyi=Hero('houyi',250,23) yase.level=yase.level+1
caihong=Hero('caihong',5600,199) yase.hp=yase.hp+50
print(yase.attack) yase.attack=yase.attack+10
print(houyi.attack) yase=Hero("亚瑟",300,20)
print(caikong.attack) print('亚瑟的初始血量',yase.hp)
\ No newline at end of file upgrade()
upgrade()
upgrade()
print('亚瑟的升级血量',yase.hp)
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment