| iphone Programming Glossary: ccmovetoRandom Sprite Destinations http://stackoverflow.com/questions/3817637/random-sprite-destinations  4.0 int rangeDuration maxDuration minDuration int actualDuration arc4random rangeDuration minDuration id actionMove CCMoveTo actionWithDuration actualDuration position ccp 160 0 id actionMoveDone CCCallFuncN actionWithTarget self selector @selector.. 4.0 int rangeDuration maxDuration minDuration int actualDuration arc4random rangeDuration minDuration id actionMove CCMoveTo actionWithDuration actualDuration position ccp target.contentSize.width 2 actualY id actionMoveDone CCCallFuncN actionWithTarget.. would probably be less confusing posted as another question but I'll answer it here anyway P Your line id actionMove CCMoveTo actionWithDuration actualDuration position ccp 160 0 is what tells the sprite where to move. If you want to randomise it.. 
 CCMoveTo of Cocos2D http://stackoverflow.com/questions/5734072/ccmoveto-of-cocos2d  of Cocos2D  i have two CCSprite on the scene CCSprite spriteA CCSprite spriteB spriteB's position is fixed and spriteA's.. view CGPoint convertedLocation CCDirector sharedDirector convertToGL location spriteA stopAllActions spriteA runAction CCMoveTo actionWithDuration 1 position convertedLocation it can be moved but not only four direction and how can i use spriteB stop.. convertedLocation.x 0.0f else convertedLocation ccp 0.0f convertedLocation.y spriteA stopAllActions spriteA runAction CCMoveTo actionWithDuration 1 position convertedLocation Next you'll need to implement collision detection and see if the sprite.. 
 |