def _update_position(self, g, value): #print "UPDATING WITH MOVE" + str(value) if self.fen == g.current_fen(): return if self.fen == sf.get_fen(g.start_position,g.moves[:-1]): # Animate if this is a new move on current fen self._moving_piece_from = self.square_number(g.moves[-1][:2]) self._moving_piece = self.position[self._moving_piece_from] self._moving_piece_pos[0], self._moving_piece_pos[1] = self._to_coordinates(self._moving_piece_from) animation = Animation(_moving_piece_pos=self._to_coordinates(self.square_number(g.moves[-1][2:4])), duration=0.1, t='in_out_sine') animation.fen=g.current_fen() animation.bind(on_complete=self._update_after_animation) animation.start(self) else: self.set_position(g.current_fen()) self._draw_board() self._draw_pieces()