Boss2FinalArmWaveState::Boss2FinalArmWaveState(EnermyData *pData)
{
    this->pData = pData;

    moveAroundDelay = 0;

    float x = ((Boss2FinalData*)pData)->joints[0]->getBody().x + ((Boss2FinalData*)pData)->joints[0]->getBody().width / 2;
    float y = ((Boss2FinalData*)pData)->joints[0]->getBody().y + ((Boss2FinalData*)pData)->joints[0]->getBody().height / 2;

    speed = 5.0f;
    currFrame = 0;
    
    if (((Boss2FinalData*)pData)->armSide == Boss2FinalData::ArmSide::LEFT)
    {
        moveAround(((Boss2FinalData*)pData)->joints[1], ((Boss2FinalData*)pData)->joints[0], 0, speed,
            -1, Boss2FinalJoint::MoveAroundDirection::Negative);
    }
    else
    {
        moveAround(((Boss2FinalData*)pData)->joints[1], ((Boss2FinalData*)pData)->joints[0], 0, speed,
            -1, Boss2FinalJoint::MoveAroundDirection::Positive);
    }
    
    ((Boss2FinalData*)pData)->joints[2]->moveFollow(((Boss2FinalData*)pData)->joints[1]);
    ((Boss2FinalData*)pData)->joints[3]->moveFollow(((Boss2FinalData*)pData)->joints[2]);
    ((Boss2FinalData*)pData)->joints[4]->moveFollow(((Boss2FinalData*)pData)->joints[3]);
}
Beispiel #2
0
void QHeader::mouseReleaseEvent( QMouseEvent *m )
{
    if ( m->button() != LeftButton )
	return;
    State oldState = state;
    state = Idle;
    switch ( oldState ) {
    case Pressed:
	repaint(sRect( handleIdx ));
	if ( sRect( handleIdx ).contains( m->pos() ) )
	    emit sectionClicked( handleIdx );
	break;
    case Sliding: {
	int s = orient == Horizontal ? m->pos().x() : m->pos().y();
	// setCursor( arrowCursor ); // We're probably still there...
	handleColumnResize( handleIdx, s, TRUE );
	} break;
    case Moving: {
	setCursor( arrowCursor );
	if ( handleIdx != moveToIdx && moveToIdx != -1 ) {
	    moveAround( handleIdx, moveToIdx );
	    emit moved( handleIdx, moveToIdx );
	    repaint();
	} else {
	    if ( sRect( handleIdx).contains( m->pos() ) )
		emit sectionClicked( handleIdx );
	    repaint(sRect( handleIdx ));
	}
	break;
    }
    case Blocked:
	//nothing
	break;
    default:
	// empty, probably.  Idle, at any rate.
	break;
    }
}