예제 #1
0
/**
 * @brief Updates the movements: detects the collisions
 * in order to restart the movement.
 */
void PathMovement::update() {

  PixelMovement::update();

  if (!is_suspended() && is_current_elementary_move_finished()) {
    start_next_elementary_move();
  }
}
예제 #2
0
/**
 * \brief Starts or restarts the movement.
 */
void PathMovement::restart() {

  this->remaining_path = initial_path;
  this->snapping = false;
  this->stop_snapping_date = 0;
  this->stopped_by_obstacle = false;

  start_next_elementary_move();
}
예제 #3
0
/**
 * \brief Updates the movements: detects the collisions
 * in order to restart the movement.
 */
void PathMovement::update() {

  if (!is_suspended() && is_current_elementary_move_finished()) {
    start_next_elementary_move();
  }

  // Do this at last so that Movement::update() knows whether we are finished.
  PixelMovement::update();
}
예제 #4
0
/**
 * \brief Updates the movements: detects the collisions
 * in order to restart the movement.
 */
void PathMovement::update() {

  while (!is_suspended()
      && is_current_elementary_move_finished()
      && !PathMovement::is_finished()
      && get_entity() != NULL) {
    start_next_elementary_move();
    PixelMovement::update();
  }

  // Do this at last so that Movement::update() knows whether we are finished.
  PixelMovement::update();
}