当点击的时候,如果不是按照开始点击计算的,那么持续点击会导致不会变大。
void Piece::setActived(bool active)
{
_actived = active;
CCAction *scale;
if (_actived)
{
scale = CCScaleTo::create(0.2, 1.2);
}
else
{
scale = CCScaleTo::create(0.2, 1);
}
this->runAction(scale);
}
void Piece::setActived(bool active)
{
if(_actived==active)
{
return ;
}
else
{
_actived = active;
CCAction *scale;
if (_actived)
{
scale = CCScaleTo::create(0.2, 1.2);
}
else
{
scale = CCScaleTo::create(0.2, 1);
}
this->runAction(scale);
}
}