Note that there are some explanatory texts on larger screens.

plurals
  1. POCCMoveTo is not woking in Cocos2d android
    primarykey
    data
    text
    <p>I am working on tetris type of game. In normal its working well. But when i press back and renters . bricks doesnt falls. That means CCMoveTo is not seems to be like working. here is my code part </p> <pre><code>CCMoveTo actionMove1 = CCMoveTo.action(actualDuration/divisor, CGPoint.ccp(randwidth , targetHeight)); CCCallFuncN actionMoveDone1 = CCCallFuncN.action(this, "spriteMoveFinished"); CCSequence actions1 = CCSequence.actions(actionMove1, actionMoveDone1); target.runAction(actions1); </code></pre> <p>and my spriteMoveFinished method</p> <pre><code>public void spriteMoveFinished(Object sender) { target=(CCSprite) sender; if(targetHeight&lt;=(newtarget+target.getContentSize().height/2)) { CCMoveTo actionMove = CCMoveTo.action(0 , CGPoint.ccp(randwidth ,(newtarget+target.getContentSize().height/2))); CCCallFuncN actionMoveDone = CCCallFuncN.action(this, "spriteMoveFinishedy"); CCSequence actions = CCSequence.actions(actionMove, actionMoveDone); target.runAction(actions); arraycounter++; int n= Height/brick; targetHeight=n*brick; if(xpos!=position) { CCBlink u=CCBlink.action(3f, 3); CCCallFuncN actionMoveDone1 = CCCallFuncN.action(this, "spriteMoveFinishedx"); CCSequence actions1 = CCSequence.actions(u, actionMoveDone1); target.runAction(actions1); } else { updateHeight(shape,position); gameLogic(); } } else { // for continuation motion of CCSprite if(tag==0) { targetHeight=targetHeight-brick; newtarget=positioning(shape,position); if(targetHeight&lt;newtarget+target.getContentSize().height/2) { targetHeight=(int) ( newtarget+target.getContentSize().height/2); } CCMoveTo actionMove = CCMoveTo.action(actualDuration/divisor, CGPoint.ccp(randwidth ,targetHeight)); CCCallFuncN actionMoveDone = CCCallFuncN.action(this, "spriteMoveFinished"); CCSequence actions = CCSequence.actions(actionMove, actionMoveDone); target.runAction(actions); tag=1; } // to stuck the CCSprite movement else { CCMoveTo actionMove = CCMoveTo.action(actualDuration/latedivisor , CGPoint.ccp(randwidth ,targetHeight)); CCCallFuncN actionMoveDone = CCCallFuncN.action(this, "spriteMoveFinished"); CCSequence actions = CCSequence.actions(actionMove, actionMoveDone); target.runAction(actions); tag=0; } } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload