Exemplo n.º 1
0
 def defend(self):
     if hero.battle:
         lahing('d',hero)
         self.refelud()
         self.refmon()
         if not hero.battle:
             self.meludease=Label(self,bg="black").grid(row=3,column=11,columnspan=3,sticky=(N,W,S,E))
             if hero.mloc[0]==0:
                 if hero.mloc[1]==1:
                     self.right()
                 else:
                     self.left()
             elif hero.mloc[0]==-1:
                 self.up()
             else:
                 self.down()
Exemplo n.º 2
0
 def attack(self):
     if hero.battle:
         lahing('a',hero)
         self.refelud()
         self.refmon()
         if hero.battle=="end":
             global message
             message="You have WON"
             self.quit()
         if not hero.battle:
             self.meludase=Label(self,bg="black").grid(row=3,column=11,columnspan=3,sticky=(N,W,S,E))
             if hero.mloc[0]==0:
                 if hero.mloc[1]==1:
                     self.right()
                 else:
                     self.left()
             elif hero.mloc[0]==-1:
                 self.up()
             else:
                 self.down()