Ejemplo n.º 1
0
  public void update() {
    if (left_driving_box_ != null) {
      x_ =
          left_driving_box_.x()
              + left_driving_box_.get_width() / 2
              + Settings.BOX_GAP
              + get_width() / 2;
      y_ = left_driving_box_.y();
    } else if (falling_) update_position();

    if (height_driver_ != null) y_ = height_driver_.y();

    check_off_screen();
  }
Ejemplo n.º 2
0
  // override this to catch stop falling events
  protected void stopped_falling() {
    if (colliding_box_ != null) {
      y_ =
          colliding_box_.y()
              - colliding_box_.get_height() / 2
              - Settings.BOX_GAP
              - get_height() / 2;
    }

    if (drive_this_height_ != null) drive_this_height_.set_y(y_);
  }