demos/sub-attaq/bomb.cpp
changeset 3 41300fa6a67c
parent 0 1918ee327afb
child 4 3b1da2848fc7
equal deleted inserted replaced
2:56cd8111b7f7 3:41300fa6a67c
    72     launchAnimation->addAnimation(anim);
    72     launchAnimation->addAnimation(anim);
    73     anim = new QPropertyAnimation(this, "pos");
    73     anim = new QPropertyAnimation(this, "pos");
    74     anim->setEndValue(QPointF(x() + delta*2,scene()->height()));
    74     anim->setEndValue(QPointF(x() + delta*2,scene()->height()));
    75     anim->setDuration(y()/2*60);
    75     anim->setDuration(y()/2*60);
    76     launchAnimation->addAnimation(anim);
    76     launchAnimation->addAnimation(anim);
    77     connect(anim,SIGNAL(valueChanged(const QVariant &)),this,SLOT(onAnimationLaunchValueChanged(const QVariant &)));
    77     connect(anim,SIGNAL(valueChanged(QVariant)),this,SLOT(onAnimationLaunchValueChanged(QVariant)));
    78     connect(this, SIGNAL(bombExploded()), launchAnimation, SLOT(stop()));
    78     connect(this, SIGNAL(bombExploded()), launchAnimation, SLOT(stop()));
    79     //We setup the state machine of the bomb
    79     //We setup the state machine of the bomb
    80     QStateMachine *machine = new QStateMachine(this);
    80     QStateMachine *machine = new QStateMachine(this);
    81 
    81 
    82     //This state is when the launch animation is playing
    82     //This state is when the launch animation is playing