Exemplo n.º 1
0
 def do_attack(self, dissapear=False):
     entity = self.bg.tiles[(self.x, self.y)].entity
     if entity and entity.can_be_attacked():
         if not entity.is_ally(self):
             entity.get_attacked(self)
         if dissapear:
             self.dissapear()
Exemplo n.º 2
0
 def do_attack(self, dissapear=False):
   entity = self.bg.tiles[(self.x, self.y)].entity
   if entity and entity.can_be_attacked():
     if not entity.is_ally(self):
       entity.get_attacked(self)
     if dissapear:
       self.dissapear()
Exemplo n.º 3
0
 def update(self):
   super(Orb, self).update()
   if self.alive:
     for (pos_x, pos_y) in itertools.product([-1,0,1], [-1,0,1]):
       if self.bg.is_inside(self.x+pos_x, self.y+pos_y):
         entity = self.bg.tiles[(self.x+pos_x), (self.y+pos_y)].entity
         if entity and not entity.is_ally(self) and entity not in self.attacked_entities:
           entity.get_attacked(self)
           self.attacked_entities.append(entity)
Exemplo n.º 4
0
 def update(self):
     super(Orb, self).update()
     if self.alive:
         for (pos_x, pos_y) in itertools.product([-1, 0, 1], [-1, 0, 1]):
             if self.bg.is_inside(self.x + pos_x, self.y + pos_y):
                 entity = self.bg.tiles[(self.x + pos_x),
                                        (self.y + pos_y)].entity
                 if entity and not entity.is_ally(
                         self) and entity not in self.attacked_entities:
                     entity.get_attacked(self)
                     self.attacked_entities.append(entity)