Commit 4af7ac4d by BellCodeEditor

save project

parent 40c98e48
Showing with 43 additions and 34 deletions
import turtle as a class Hero:
a.penup() def_init_(self,name,hp.attack):
a.goto(0,-150) self.level=1
a.pendown() self.name=name
a.pensize(2) self.hp=hp
a.setheading(90) self.attack=attack
a.color("brown") def upgrade():
a.forward(300) yase.level=yase.level+1
a.pensize(1) yase.hp=yase.hp+50
a.color('black','red') yase.attack=yase.attack+4
a.begin_fill() yase = Hero('后羿',240,23)
for i in range(10): houyi.upgrade()
a.left(45) print("等级为:",houyi.level)
a.circle(80,60) print("血量为:",houyi.hp)
a.left(120) print("攻击力为:",houyi.attack)
a.circle(80,60) if enemy.hp>0:
a.end_fill() info3=evemy.name+"还剩下"+str(enemy.hp)+"血量"
for i in range(2): info=info1+info2+info3
a.penup() print(info)
a.goto(0,10-50*i) \ No newline at end of file
x=20+80*i
a.setheading(x)
a.pendown()
a.color('brown','green')
a.begin_fill()
a.circle(60,60)
a.left(120)
a.circle(60,60)
a.end_fill()
a.hideturtle()
a.done()
from turtle import *
penup()
goto(0,0)
pendown()
pensize(5)
pencolor("red")
fillcolor("yellow")
begin_fill()
for i in range(5):
fd(100)
right(144)
end_fill()
done()
\ No newline at end of file
player = input("请输入(石头/剪刀/布):") player=input("玩家请出拳(石头/剪刀/布)")
print("玩家出拳:"+player) print("玩家出拳:"+player)
\ No newline at end of file import random
list=["石头","剪刀","布"]
computer=random.choice(list)
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