coco2d-x 3.3中的连续跳跃问题

想让一个精灵,实现连续跳跃,我写的代码如下:
Button jump = (Button)(node->getChildByName(“jump”));
jump->addTouchEventListener(CC_CALLBACK_2(HelloWorld::jumpCallback, this));

void HelloWorld::jumpCallback(Ref* pSender, Widget::TouchEventType touchType)
{
if (touchType == Widget::TouchEventType::ENDED)
{
Sprite * girl = (Sprite*)(node->getChildByName(“girl”));
MoveTo *move1 = MoveTo::create(0.2, Vec2(girl->getPosition().x, girl->getPosition().y + 100));
MoveTo *move2 = MoveTo::create(0.2, Vec2(137.5, 184.5));
CallFunc *call = CallFunc::create(CC_CALLBACK_0(HelloWorld::startCallback, this));
Sequence *action = Sequence::create(move1, move2, call, NULL);
girl->runAction(action);
}

}
但是没有实现连续跳跃的效果。
求大神指导,感激不尽

额,为什么不用JumpTo或者JumpBy:9:

void HelloWorld::jumpCallback(Ref* pSender, Widget::TouchEventType touchType)
{
if (touchType == Widget::TouchEventType::ENDED)
{
Sprite * girl = (Sprite*)(node->getChildByName(“girl”));
JumpTo *move1 = JumpTo::create(0.2, Vec2(girl->getPosition().x, girl->getPosition().y), 100, 1);
CallFunc *call = CallFunc::create(CC_CALLBACK_0(HelloWorld::startCallback, this));
Sequence *action = Sequence::create(move1, call, NULL);
girl->runAction(action);
}

}
修改成JumpTo,也没实现效果,位置就乱了

void HelloWorld::jumpCallback(Ref* pSender, Widget::TouchEventType touchType)
{
if (touchType == Widget::TouchEventType::ENDED)
{
Sprite * girl = (Sprite*)(node->getChildByName(“girl”));
JumpTo *jump = JumpTo::create(0.2, Vec2(girl->getPosition().x, girl->getPosition().y), 100, 1);
girl->runAction(jump);
}
}
我把代码简化了一下,按一下没问题,连续按,位置就乱了

所谓的连续按是指什么?他还没跳完你就按?

对的,没跳完就按

类似于 天天酷跑类游戏 的连续跳跃

对,连续跳跃,第一次没完,就跳第二次。 类似于 天天酷跑类游戏 的连续跳跃

这就是逻辑问题了,你这样子直接用,不做任何修改肯定会出问题。设置一个点击次数,每次动作没执行完就点击的话,+1,跳跃的高度不能写死,乘以这个点击次数.再加个动作执行完的回调函数,把次数清0
大概就这样,具体的自己写写

谢谢,我试试去