Ejemplo n.º 1
0
 def do(self):
     # TODO: Make sure target is still in range
     from_coords = Point3(*board_coordinates(self.attacker.x, self.attacker.y, self.attacker.height))
     to_coords = Point3(*board_coordinates(self.target.x, self.target.y, self.target.height))
     i_move_to = LerpPosInterval(self.attacker.nodePath, 0.1, to_coords, blendType='easeIn')
     i_move_from = LerpPosInterval(self.attacker.nodePath, 0.1, from_coords, blendType='easeOut')
     i_finish = Func(self.post_do)
     i_sequence = Sequence(i_move_to, i_move_from, i_finish)
     i_sequence.start()
Ejemplo n.º 2
0
 def do(self):
     inhabitants = self.tile.get_inhabitants()
     if inhabitants:
         # TODO: Maybe move somewhere else?
         app.state.demand('Charge')
     else:
         to_coords = Point3(*board_coordinates(self.tile.x, self.tile.y, self.tile.height))
         i_move = LerpPosInterval(self.mover.nodePath, 0.5, to_coords)
         i_finish = Func(self.post_do)
         i_sequence = Sequence(i_move, i_finish)
         i_sequence.start()