Ejemplo n.º 1
0
Archivo: npc.py Proyecto: kirsis/rogue
 def place(self, x, y):
     res = Being.place(self, x, y)
     if not res: return
     
     if self.target_pos == None:
         self.target_pos = (self.x, self.y)
     if self.target_pos == (self.x, self.y):
         self.get_new_target()
         print "From %s to %s" % (str((self.x, self.y)), str(self.target_pos))
         path_compute(self.path, self.x, self.y, *self.target_pos)
         self.path_index = 0
     return res
Ejemplo n.º 2
0
    def place(self, x, y):
        res = Being.place(self, x, y)
        if not res: return

        if self.target_pos == None:
            self.target_pos = (self.x, self.y)
        if self.target_pos == (self.x, self.y):
            self.get_new_target()
            print "From %s to %s" % (str(
                (self.x, self.y)), str(self.target_pos))
            path_compute(self.path, self.x, self.y, *self.target_pos)
            self.path_index = 0
        return res
Ejemplo n.º 3
0
 def __init__(self, backend, config):
     Being.__init__(self, backend, config)
     self.path = path_new_using_map(backend.current_area.tcod_map)
     self.target_pos = None
Ejemplo n.º 4
0
Archivo: npc.py Proyecto: kirsis/rogue
 def __init__(self, backend, config):
     Being.__init__(self, backend, config)
     self.path = path_new_using_map(backend.current_area.tcod_map)
     self.target_pos = None
Ejemplo n.º 5
0
 def __init__(self, backend, config):
     Being.__init__(self, backend, config)
Ejemplo n.º 6
0
 def place(self, x, y):
     res = Being.place(self, x, y)
     if res == True:
         self.compute_fov()
     return res
Ejemplo n.º 7
0
 def __init__(self, backend, config):
     Being.__init__(self, backend, config)
Ejemplo n.º 8
0
 def place(self, x, y):
     res = Being.place(self, x, y)
     if res == True:
         self.compute_fov()
     return res