+
+ /* stop backflipping at will */
+ if( backflipping && ( !controller->hold(Controller::JUMP) && !backflip_timer.started()) ){
+ backflipping = false;
+ backflip_direction = 0;
+ sprite->set_angle(0.0f);
+ }
+}
+
+void
+Player::position_grabbed_object()
+{
+ MovingObject* moving_object = dynamic_cast<MovingObject*>(grabbed_object);
+ assert(moving_object);
+
+ // Position where we will hold the lower-inner corner
+ Vector pos(get_bbox().get_left() + get_bbox().get_width()/2,
+ get_bbox().get_top() + get_bbox().get_height()*0.66666);
+
+ // Adjust to find the grabbed object's upper-left corner
+ if (dir == LEFT)
+ pos.x -= moving_object->get_bbox().get_width();
+ pos.y -= moving_object->get_bbox().get_height();
+
+ grabbed_object->grab(*this, pos, dir);