Commit 4addd55d by BellCodeEditor

save project

parent c6ed6700
Showing with 10 additions and 17 deletions
class Monster: class Hero:
def __init__(self,name,hp,attack): def __init__(self,name,hp,attack):
self.level = 1 self.level = 1
self.name = name self.name = name
self.hp = hp self.hp = hp
self.attack = attack self.attack = attack
wd=Hero('wd',999999999,99999999999)
frogy = Monster("frogy",10,2) lj=Hero('lj',0.00001,0.0001)
flowy = Monster("flowy",20,1) def op():
creeper = Monster("creeper",20,25) wd.level+=1
wd.attack+=9999
def upgrade(name): wd.hp+=99999
name.level = name.level + 1 op()
name.hp = name.hp + 5 print(lj.attack)
name.attack = name.attack + 2 print(wd.attack)
upgrade(frogy)
print(frogy.level)
print(frogy.hp)
print(frogy.attack)
\ 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