Commit b8764725 by BellCodeEditor

auto save

parent ce0a9cdb
Showing with 26 additions and 15 deletions
class Hero: import turtle as t
def __init__(self,name,hp,attack): import random as r
self.level=1 t.setup(1000,800)
self.name=name t.screensize(800,600,'skyblue')
self.hp=hp def draw_circle(radius,color,y_position):
self.attack=attack t.penup()
def upgrade(self): t.pensize(3)
self.hp=self.hp+50 t.fillcolor(color)
self.level=self.level+1 t.goto(0,y_position)
self.attack=self.attack+4 t.pendown()
yase=Hero("yase",300,20) t.begin_fill()
houyi=Hero("houyi",300,20) t.circle(radius)
yase.upgrade() t.end_fill()
print(yase.hp) def draw_bullet():
\ No newline at end of file t.penup()
t.goto(r.randint(-200,200),r.randint(-200,200))
t.pendown()
t.dot(20)
draw_circle(200,'yellow',-200)
draw_circle(150,'red',-150)
draw_circle(100,'blue',-100)
draw_circle(50,'skyblue',-50)
for i in range(5):
draw_bullet()
t.done()
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