62 QPropertyAnimation *launchAnimation = new QPropertyAnimation(this, "pos"); |
62 QPropertyAnimation *launchAnimation = new QPropertyAnimation(this, "pos"); |
63 AnimationManager::self()->registerAnimation(launchAnimation); |
63 AnimationManager::self()->registerAnimation(launchAnimation); |
64 launchAnimation->setEndValue(QPointF(x(),qobject_cast<GraphicsScene *>(scene())->sealLevel() - 15)); |
64 launchAnimation->setEndValue(QPointF(x(),qobject_cast<GraphicsScene *>(scene())->sealLevel() - 15)); |
65 launchAnimation->setEasingCurve(QEasingCurve::InQuad); |
65 launchAnimation->setEasingCurve(QEasingCurve::InQuad); |
66 launchAnimation->setDuration(y()/currentSpeed*10); |
66 launchAnimation->setDuration(y()/currentSpeed*10); |
67 connect(launchAnimation,SIGNAL(valueChanged(const QVariant &)),this,SLOT(onAnimationLaunchValueChanged(const QVariant &))); |
67 connect(launchAnimation,SIGNAL(valueChanged(QVariant)),this,SLOT(onAnimationLaunchValueChanged(QVariant))); |
68 connect(this,SIGNAL(torpedoExploded()), launchAnimation, SLOT(stop())); |
68 connect(this,SIGNAL(torpedoExploded()), launchAnimation, SLOT(stop())); |
69 |
69 |
70 //We setup the state machine of the torpedo |
70 //We setup the state machine of the torpedo |
71 QStateMachine *machine = new QStateMachine(this); |
71 QStateMachine *machine = new QStateMachine(this); |
72 |
72 |