Exemple #1
0
 def process_ui(self):
     data = self.ui.data
     if data.mode == I_BROWSE:
         pass
     elif data.mode == I_MOVE:
         if data.dest:
             path = astar.path(self.map, data.selected.pos, data.dest)
             x,y = self.ui.data.selected.pos
             self.map.grid[x][y].move_path(path)
     elif data.mode == I_ATTACK:
         pass
     else:
         print "Unexpected Mode"
Exemple #2
0
 def process_ui(self):
     data = self.ui.data
     if data.mode == I_BROWSE:
         pass
     elif data.mode == I_MOVE:
         if data.dest:
             path = astar.path(self.map, data.selected.pos, data.dest)
             x, y = self.ui.data.selected.pos
             self.map.grid[x][y].move_path(path)
     elif data.mode == I_ATTACK:
         pass
     else:
         print "Unexpected Mode"
Exemple #3
0
 def move_character(self, e):
     pos = self.map.obj_list[e.name]
     path = astar.path(self.map, pos, e.dest)
     x,y = pos
     self.map.grid[x][y].move_path(path)
Exemple #4
0
 def move_character(self, e):
     pos = self.map.obj_list[e.name]
     path = astar.path(self.map, pos, e.dest)
     x, y = pos
     self.map.grid[x][y].move_path(path)