Commit d712c6dc by BellCodeEditor

save project

parent 81af85a6
Showing with 10 additions and 27 deletions
class Hero: import turtle
def __init__(self,name,hp,attack): pen=turtle.Pen()
self.level = 1 pen.write("何当共剪西窗烛,\n更话巴山夜雨时。",font=("Times",20,"normal"))
self.name = name pen.hideturtle()
self.hp= hp turtle.done()
self.attack= attack \ No newline at end of file
def upgrade(self):
self.level=houyi.level+1
self.hp=houyi.hp+50
self.attack=houyi.attack+4
houyi = Hero("houyi",200,40)
houyi.upgrade()
print("hy",houyi.level)
print("now",houyi.hp)
print("jj",houyi.attack)
\ No newline at end of file
import turtle import turtle
pen=turtle.Pen() pen=turtle.Pen()
pen.shape("turle") pen.write("何当共剪西窗烛,\n更话巴山夜雨时。",font=("Times",20,"normal"))
pen.fillcolor("red") pen.hideturtle()
pen.begin_fill() turtle.done()
for i in range(5) \ No newline at end of file
pen.forward(200)
pen.right(144)
pen.end_fill()
turtle.done
\ 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