<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.1" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>cocos2d for iPhone &#187; Tag: actions - Recent Topics</title>
		<link>http://www.cocos2d-iphone.org/forum/tags/actions</link>
		<description>A fast, easy to use, free, and community supported 2D game engine</description>
		<language>en-US</language>
		<pubDate>Fri, 10 Feb 2012 04:08:45 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.1</generator>
		<textInput>
			<title><![CDATA[Search]]></title>
			<description><![CDATA[Search all topics from these forums.]]></description>
			<name>q</name>
			<link>http://www.cocos2d-iphone.org/forum/search.php</link>
		</textInput>
		<atom:link href="http://www.cocos2d-iphone.org/forum/rss/tags/actions/topics" rel="self" type="application/rss+xml" />

		<item>
			<title>lynerd on "Sprite Movement"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28755#post-141701</link>
			<pubDate>Sun, 29 Jan 2012 03:58:09 +0000</pubDate>
			<dc:creator>lynerd</dc:creator>
			<guid isPermaLink="false">141701@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I set up an Actor class that will act as the base for all my entities in my game. I want the sprite to move in only one direction at a time and from tile to tile, example being the pokemon games. I got all of that working fine, but there a few problems I am running into.</p>
<p>-When the sprite is moving, it sometimes gets "jittery" as it moves along its action path. This is in the simulator and on my iphone 3gs.</p>
<p>-Also, since I am using an action to move the sprite, I can't get a continuous movement. Actions do not flow well into the next move action. It moves the correct number of pixels, but then stops and starts again. It looks very jerky.</p>
<p>Any tips or help would be appreciated. Here is my movement code:<br />
<pre><code>typedef enum {
    kDirectionNone,
    kDirectionSouth,
    kDirectionWest,
    kDirectionNorth,
    kDirectionEast
} Direction;

-(void) moveInDirection:(Direction)direction
{
    if(!_moving)
    {
        _oldPosition = self.position;
        _moving = YES;

        if(direction == kDirectionNorth)
        {
            [self runAction:[CCMoveBy actionWithDuration:_duration position:ccp(0, -_distance)]];
            _newPosition = ccp(self.position.x, self.position.y - _distance);
        }
        else if(direction == kDirectionSouth)
        {
            [self runAction:[CCMoveBy actionWithDuration:_duration position:ccp(0, _distance)]];
            _newPosition = ccp(self.position.x, self.position.y + _distance);
        }
        else if(direction == kDirectionWest)
        {
            [self runAction:[CCMoveBy actionWithDuration:_duration position:ccp(-_distance, 0)]];
            _newPosition = ccp(self.position.x - _distance, self.position.y);
        }
        else if(direction == kDirectionEast)
        {
            [self runAction:[CCMoveBy actionWithDuration:_duration position:ccp(_distance, 0)]];
            _newPosition = ccp(self.position.x + _distance, self.position.y);
        }
    }

    if(self.position.x == _newPosition.x &#38;&#38; self.position.y == _newPosition.y)
    {
        _moving = NO;
    }
}</code></pre></description>
		</item>
		<item>
			<title>invulse on "[Tool] Export timeline animations from Adobe Flash and import as Cocos2d Actions"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/6239#post-36574</link>
			<pubDate>Fri, 07 May 2010 05:41:08 +0000</pubDate>
			<dc:creator>invulse</dc:creator>
			<guid isPermaLink="false">36574@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>While working on my current project which uses a lot of cocos2d actions to create character animations (as opposed to frame by frame animations)  I found it incredibly difficult to make decent looking animations as I had to do trial and error to place movements. </p>
<p>So today I start building a tool in AIR and an interpreter in Obj-C which will allow you to take a timeline animation in Adobe Flash, export the keyframes into my tool then export a PList file for Obj-c which my interpreter will convert to Cocos2d actions.  So far everything is going well, but I still have bug testing and project saving/loading to implement. </p>
<p>Currently the tool will take the position of the object in flash and can handle changes in x,y,scaleX,scaleY and rotation for 'Classic Tweens', but not the new Motion Editor Tweens.  It also will account for basic easing from flash and convert into CCEaseIn or CCEaseOut actions.</p>
<p>I will release the tool and source as soon as bug test some more and complete the AIR tool.</p>
<p>Here is a quick video demo I made showing how to export from flash to my tool then to Cocos2d (sorry about the big green watermark, but I havent payed for IShowU yet):</p>
<p><a href="http://www.youtube.com/watch?v=8ZyqGrdkTtM" rel="nofollow">http://www.youtube.com/watch?v=8ZyqGrdkTtM</a>
</p></description>
		</item>
		<item>
			<title>zzt4 on "Graphical glitch using per-character animation"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28666#post-141263</link>
			<pubDate>Wed, 25 Jan 2012 21:22:52 +0000</pubDate>
			<dc:creator>zzt4</dc:creator>
			<guid isPermaLink="false">141263@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I am currently animating each character in a CCLabelBMFont. Sometimes when the animation finishes, the label can end up looking weird. Anyone have any ideas what could be causing this?</p>
<pre><code>double totalTime = 1.0f;
int currentCharIndex = 0;
CCMenu* _menu = (CCMenu*)[self getChildByTag:kNodeTagLabelMenu];
CCNode* _node;
CCARRAY_FOREACH([_menu children], _node) {
    CCNode* _labelNode;
    CCARRAY_FOREACH([_node children], _labelNode) {
        double individualTime = totalTime / [[_labelNode children] count];
        CCNode* _charNode;
        CCARRAY_FOREACH([_labelNode children], _charNode) {
            _charNode.scale = 0.5;
            [_charNode runAction:[CCSequence actions:[CCDelayTime actionWithDuration:individualTime * currentCharIndex],
                                                     [CCSpawn actions:[CCScaleTo actionWithDuration:0.1f scale:1.0],
                                                                      [CCFadeIn actionWithDuration:0.1f],
                                                                      [CCMoveBy actionWithDuration:0.1f position:ccp(0, -20)],
                                                                      nil],
                                                     nil]];

            currentCharIndex++;
        }
        currentCharIndex = 0;
    }
}</code></pre>
<p>The animation always runs successfully and looks great.<br />
However, sometimes the end of the animation looks like this: (yay!)<br />
[IMG]http://i42.tinypic.com/330xquc.jpg[/IMG]</p>
<p>And then sometimes it looks like this: (boo!)<br />
[IMG]http://i42.tinypic.com/ohllc0.jpg[/IMG]
</p></description>
		</item>
		<item>
			<title>NOG on "Vertical black line artifacts when using CCMoveTo"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28040#post-137799</link>
			<pubDate>Tue, 03 Jan 2012 19:08:47 +0000</pubDate>
			<dc:creator>NOG</dc:creator>
			<guid isPermaLink="false">137799@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Earlier I had problems with tiles and sprites creating unsightly artifacts (like black vertical lines) and I learned that it was caused by floating point rounding issues. So, my solution was to get the floor values for new tile/sprite positions so they lay perfectly on a pixel, and also add [_soilSprite.texture setAliasTexParameters] to every sprite class.  </p>
<p>Now I have the same issue with moving the entire map with CCMoveTo. It's necessary to use this action because my update action is paused.  The problem is that I have no idea how to prevent CCMoveTo placing tiles "in between pixels" while it's animating. I'd rather have it floor new coordinates while animating so it doesn't do this. Any ideas? Thanks.
</p></description>
		</item>
		<item>
			<title>fireblink on "CCDirector,notificationNode problem with actions."</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/27916#post-137058</link>
			<pubDate>Wed, 28 Dec 2011 08:51:37 +0000</pubDate>
			<dc:creator>fireblink</dc:creator>
			<guid isPermaLink="false">137058@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hi everybody! Sorry for repost, but it seams that my previous thread was corrupted :( I'm not able to post anything there, it shows that last poster was riq (but no messages from him), when I try to change message I get that thread not found. So I decided to repost it.</p>
<p>So, my problem:</p>
<p>Recently I've decided to create my own notification system. Everything was fine until I needed to use some time dependent actions.<br />
They are not working for any node that is added to the notificationNode. CCMoveTo, CCFadeIn, CCDelayTime, etc...</p>
<p>But CCCallBlock is working. Maybe there is something I've missed up.</p>
<p>What I've done:</p>
<pre><code>@interface TTNotificationNode : CCNode
@end

#<a href='http://www.cocos2d-iphone.org/forum/tags/import'>import</a> &#34;TTNotificationNode.h&#34;
@implementation TTNotificationNode

- (id) init
{
    if((self = [super init])){
        CGSize winSize = [[CCDirector sharedDirector] winSize];

        [self setContentSize:winSize];
        self.anchorPoint = CGPointMake(0.0f, 0.0f);

        //register notification node
        [[CCDirector sharedDirector] setNotificationNode:self];

       //add some sprite
        CCSprite * notification = [CCSprite spriteWithFile:@&#34;notification_background.png&#34;];
        notification.anchorPoint = CGPointMake(0.5f, 1.0f);
        notification.position = CGPointMake(winSize.width/2, winSize.height/2);
        [self addChild:notification];

        //call some block
        [notification runAction:[CCCallBlock:^{
            CCLOG(@&#34;DA BOOM!&#34;);
        }];

        //move it
        [notification runAction:[CCMoveBy actionWithDuration:2.0f position:CGPointMake(250, 250)]];
    }
    return self;
}
@end</code></pre>
<p>I'm using v1.1
</p></description>
		</item>
		<item>
			<title>Heartbound on "Accessing an action by tag in Cocos2D."</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/27908#post-137031</link>
			<pubDate>Wed, 28 Dec 2011 00:25:05 +0000</pubDate>
			<dc:creator>Heartbound</dc:creator>
			<guid isPermaLink="false">137031@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I have an action that I declared in the -init method.<br />
  -(id) init<br />
{<br />
        if( (self=[super init])) {<br />
            sprite = [CCSprite spriteWithFile:@"Icon@2x.png"];<br />
            sprite.position = ccp(150,150);<br />
            [self addChild:sprite];<br />
            sprite.tag = 13;<br />
            self.isTouchEnabled = YES;</p>
<p>            CCAction *anAction = [CCBlink actionWithDuration:5 blinks:10];<br />
            anAction.tag = 15;<br />
    }<br />
    return self;<br />
}</p>
<p>Now, I can access the sprite without any problems.<br />
-(void)ccTouchesBegan:(NSSet *)touch withEvent:(UIEvent *)event {</p>
<p>CCNode *node = [self getChildByTag:13];<br />
NSAssert([node isKindOfClass:[CCSprite class]],@"is NOT member of CCSprite");<br />
CCSprite *sprite = (CCSprite *)node;<br />
sprite.scale = CCRANDOM_0_1();</p>
<p>}</p>
<p>Now I don't know how to access my action via tag.. would anyone mind showing me a small example ?
</p></description>
		</item>
		<item>
			<title>tomdelonge on "Sprite action management (smoothly stopping and controlling actions)"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/27791#post-136531</link>
			<pubDate>Thu, 22 Dec 2011 03:33:53 +0000</pubDate>
			<dc:creator>tomdelonge</dc:creator>
			<guid isPermaLink="false">136531@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I've got some characters that will be on the screen that are a CCNode with several of their properties being the sprites (head, left_arm, body, etc.) I've got it part way working, but things don't run smoothly. When the stop() method is called, I'd want the person to slow down rather than completely stopping movement (it looks strange when the legs are in running/walking motion and the body stops moving and the legs go to standing position).</p>
<p>I'm just curious overall about how to have finer control over actions.</p>
<p>Here's my code so far:</p>
<pre><code>// Person.h
#<a href='http://www.cocos2d-iphone.org/forum/tags/import'>import</a> &#60;Foundation/Foundation.h&#62;
#<a href='http://www.cocos2d-iphone.org/forum/tags/import'>import</a> &#34;cocos2d.h&#34;

@interface Person : CCNode {
    CCSprite* head;
    CCSprite* body;
    CCSprite* left_leg;
    CCSprite* right_leg;
    CCSprite* left_arm;
    CCSprite* right_arm;
    float scale;
}

enum {
    movementAnimation,
    headAnimation,
    leftArmAnimation,
    bodyAnimation,
    rightArmAnimation,
    leftLegAnimation,
    rightLegAnimation
};

-(void) walkRight;

@end

// Person.m
#<a href='http://www.cocos2d-iphone.org/forum/tags/import'>import</a> &#34;Person.h&#34;

@implementation Person

-(id) init
{
	if((self=[super init])) {
        self.position = ccp(0, 30);
        self.anchorPoint = ccp(0.5f, 0.5f);

        body = [CCSprite spriteWithSpriteFrameName:@&#34;body.png&#34;];
        body.position = ccp(0, 0);
        [self addChild:body z:5];

        left_arm = [CCSprite spriteWithSpriteFrameName:@&#34;arm_front.png&#34;];
        left_arm.anchorPoint = ccp(0.5f, 1);
        left_arm.position = ccp(-8, 6);
        [self addChild:left_arm z:10];

        right_arm = [CCSprite spriteWithSpriteFrameName:@&#34;arm.png&#34;];
        right_arm.anchorPoint = ccp(0.5f, 1);
        right_arm.position = ccp(8, 6);
        [self addChild:right_arm z:3];

        left_leg = [CCSprite spriteWithSpriteFrameName:@&#34;leg.png&#34;];
        left_leg.position = ccp(-3, -4);
        left_leg.anchorPoint = ccp(0.5f, 1);
        [self addChild:left_leg z: 8];

        right_leg = [CCSprite spriteWithSpriteFrameName:@&#34;leg_front.png&#34;];
        right_leg.position = ccp(4, -4);
        right_leg.anchorPoint = ccp(0.5f, 1);
        [self addChild:right_leg z:3];

        head = [CCSprite spriteWithSpriteFrameName:@&#34;head.png&#34;];
        head.anchorPoint = ccp(0.5f, 0);
        head.position = ccp(0, 6);
        [self addChild:head z: 8];

        [self scheduleUpdate];
    }
    return self;
}

-(void) update :(ccTime) dt
{
}

-(void) stop
{
    [self stopActionByTag:movementAnimation];
    [head stopActionByTag:headAnimation];
    [left_arm stopActionByTag:leftArmAnimation];
    [right_arm stopActionByTag:rightArmAnimation];
    [left_leg stopActionByTag:leftLegAnimation];
    [right_leg stopActionByTag:rightLegAnimation];

    CCAction *slow = [CCRotateTo actionWithDuration:0.5f angle:0];

    [head runAction:[[slow copy] autorelease]];
    [left_arm runAction:[[slow copy] autorelease]];
    [right_arm runAction:[[slow copy] autorelease]];
    [left_leg runAction:[[slow copy] autorelease]];
    [right_leg runAction:[[slow copy] autorelease]];
}

-(void) walkLeft
{

}

-(void) walkRight
{
    [self stop];
    CCAction *move = [CCMoveBy actionWithDuration:10 position:ccp(300, 0)];
    move.tag = movementAnimation;

    id headRotateLeft = [CCRotateTo actionWithDuration:0.4f angle:-3];
    id headRotateRight = [CCRotateTo actionWithDuration:0.4f angle:3];
    id headSequence = [CCSequence actions:headRotateLeft, headRotateRight, nil];
    CCAction *headRepeat = [CCRepeatForever actionWithAction:headSequence];
    headRepeat.tag = headAnimation;

    id leftArmRotateOut = [CCRotateTo actionWithDuration:0.4f angle:10];
    id leftArmRotateIn = [CCRotateTo actionWithDuration:0.4f angle:-18];
    id leftArmSequence = [CCSequence actions:leftArmRotateIn, leftArmRotateOut, nil];
    CCAction *leftArmRepeat = [CCRepeatForever actionWithAction:leftArmSequence];
    leftArmRepeat.tag = leftArmAnimation;

    id rightArmRotateOut = [CCRotateTo actionWithDuration:0.4f angle:-18];
    id rightArmRotateIn = [CCRotateTo actionWithDuration:0.4f angle:10];
    id rightArmSequence = [CCSequence actions:rightArmRotateIn, rightArmRotateOut, nil];
    CCAction *rightArmRepeat = [CCRepeatForever actionWithAction:rightArmSequence];
    rightArmRepeat.tag = rightArmAnimation;

    id leftLegRotateOut = [CCRotateTo actionWithDuration:0.4f angle:40];
    id leftLegRotateIn = [CCRotateTo actionWithDuration:0.4f angle:-15];
    id leftLegSequence = [CCSequence actions:leftLegRotateOut, leftLegRotateIn, nil];
    CCAction *leftLegRepeat = [CCRepeatForever actionWithAction:leftLegSequence];
    leftLegRepeat.tag = leftLegAnimation;

    id rightLegRotateOut = [CCRotateTo actionWithDuration:0.4f angle:15];
    id rightLegRotateIn = [CCRotateTo actionWithDuration:0.4f angle:-40];
    id rightLegSequence = [CCSequence actions:rightLegRotateIn, rightLegRotateOut, nil];
    CCAction *rightLegRepeat = [CCRepeatForever actionWithAction:rightLegSequence];
    rightLegRepeat.tag = rightLegAnimation;

    [head runAction:headRepeat];
    [left_arm runAction:leftArmRepeat];
    [right_arm runAction:rightArmRepeat];
    [left_leg runAction:leftLegRepeat];
    [right_leg runAction:rightLegRepeat];

    [self runAction:move];
}

@end</code></pre></description>
		</item>
		<item>
			<title>tomdelonge on "Managing simple sprites moving off the screen (need to remove them)"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/27757#post-136391</link>
			<pubDate>Wed, 21 Dec 2011 04:37:03 +0000</pubDate>
			<dc:creator>tomdelonge</dc:creator>
			<guid isPermaLink="false">136391@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Alright, there's many ways to accomplish this, but I'm wondering which way is best as far as efficiency, and also as far as application design. I've got a <code>CCArray</code> which contains some birds which are just sprites. They fly off the scene (the scene is approximately 5 widths of the screen, I have a function to calculate it). I need to figure out when to remove them.</p>
<p>My first idea way to simply in the <code>update</code> method, loop through the array and check if the x position was less than zero (minus the width of the sprite) or greater than the width of the scene (plus the width of the sprite). This gave me a little trouble, and feels hackish also, as I was having to minus one from <code>i</code> whenever the condition was met.</p>
<p>General example code:<br />
<pre><code>-(void) update :(ccTime) dt
{
    int count = [birds count];
    for (int i = 0; i &#60; count; i++) {
        CCSprite *bird = [birds objectAtIndex:i];
        int sceneWidth = [Scene sceneWidth];
        int width = [bird boundingBox].size.width;
        // Make sure the bird is completely out of view (no matter what anchorPoint it was given, just to be safe)
        if (bird.position.x &#60;= 0 - width &#124;&#124; bird.position.x &#62;= sceneWidth + width) {
            [self removeChild:[birds objectAtIndex:i] cleanup:YES];
            [birds removeObjectAtIndex:i];
            CCLOG(@&#34;a bird went out of bounds&#34;);
            // Update the bird count so that all indexes being checked exist
            count = [birds count];
            i--;
        }
    }
}</code></pre>
<p>So,</p>
<p>1) Should I be doing this in the update method (seems like I should not). I was thinking to somehow schedule a selector to run on each one and calculate the time it should take to move to the end of the screen and then just use moveTo, but that seems difficult (to calculate the time so the speed is correct).</p>
<p>2) What's a more "correct" way of managing arrays?
</p></description>
		</item>
		<item>
			<title>Yves on "Please help me understand actions."</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/24174#post-129335</link>
			<pubDate>Sun, 27 Nov 2011 23:17:08 +0000</pubDate>
			<dc:creator>Yves</dc:creator>
			<guid isPermaLink="false">129335@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hey guys I'm new to cocos2d and Im confused about actions. From what I have read they "act" like methods the ccsprite class would encapsulate. </p>
<p>1. Is there a proper definition to cocos2d Actions?  Is there a site that explains them in depth (beyond that they are orders that you send to a CCNode)? </p>
<p>2. What are scenarios where they are applicable and when should I write normal class methods instead?</p>
<p>Thanks so much!
</p></description>
		</item>
		<item>
			<title>waelchli on "CCCallFuncND"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/22531#post-125084</link>
			<pubDate>Tue, 08 Nov 2011 17:17:38 +0000</pubDate>
			<dc:creator>waelchli</dc:creator>
			<guid isPermaLink="false">125084@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I have a sequence of actions that delays and then does CCCallFuncND, However the method in the selector never gets called. It looks like this:<br />
<pre><code>nextPath = [[pathOrders objectAtIndex:i]intValue];
        id actionDelay = [CCDelayTime actionWithDuration:([[spawnTimes objectAtIndex:(i)] intValue])];
        id actionDone = [CCCallFuncND actionWithTarget:self selector:@selector(spawnPeople:) data:(NSInteger* ) i];
        [self runAction:[CCSequence actions:actionDelay, actionDone, nil]];</code></pre>
<p>Any ideas why from what I'm showing? I can post more crap if needed.<br />
Also I'm trying to make spawn guys every few seconds, is there another way to do this if this is a bad way?<br />
Also onEnterAfterTransitionFinished looks like it's getting called before the transition finishes, which is a bit perturbing to me but I'm not sure yet cuz this isn't running right, but how does that method work? will things called from it not run till after this scene is in place or will it try to run them and then put the scene on the screen? Thank you :)
</p></description>
		</item>
		<item>
			<title>Chris79 on "problem with stopaction and scaling down CCSprite"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/21392#post-118935</link>
			<pubDate>Fri, 30 Sep 2011 08:58:14 +0000</pubDate>
			<dc:creator>Chris79</dc:creator>
			<guid isPermaLink="false">118935@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hey!</p>
<p>Everything works fine the first time the image has been touched, the action starts and the image is scaling up and down in a sequence, repeating forever. The action should stop when the image has been touched a second time and the image should scale down to it's original size... but it doesn't. It just keeps repeating the action from the first touch as well as the scaling up and down part.</p>
<pre><code>- (BOOL)ccTouchBegan:(UITouch *)touch withEvent:(UIEvent *)event{

	CCLOG(@&#34;ccTouchBeganRuby&#34;);	 

	if (self.RubyFirstTouch == nil) {
		// we got the first touch
		self.RubyFirstTouch = touch;

		// second touch ended so remove touch only
		self.RubySecondTouch = nil;
	}
	else if (self.RubySecondTouch == nil) {
		// we got the second touch
		self.RubySecondTouch = touch;

		// first touch ended so remove both touches
		self.RubyFirstTouch = nil;

	}	

	return YES;
}

- (void)ccTouchEnded:(UITouch *)touch withEvent:(UIEvent *) event{

	//state = kRubyStateUngrabbed;
	CGSize screenSize = [[CCDirector sharedDirector] winSize]; 

	animatingRuby1.anchorPoint = ccp( 0.5, 0.5 );
	animatingRuby2.anchorPoint = ccp( 0.5, 0.5 );
	animatingRuby3.anchorPoint = ccp( 0.5, 0.5 );

	id EaseIn = [CCEaseInOut actionWithAction:[CCScaleTo actionWithDuration:0.5 scaleX:0.08f scaleY:0.08f] rate:3.0];
	id EaseOut = [CCEaseInOut actionWithAction:[CCScaleTo actionWithDuration:0.5 scaleX:0.1f scaleY:0.1f] rate:3.0];
	id action = [CCSequence actions:EaseOut,EaseIn, nil];

	id Repaction = [CCRepeatForever actionWithAction: action];

	CGPoint location = [self convertTouchToNodeSpace: touch];

	//If Rubies are touched for the 1st time then activate the bricks and let the ruby that has been touch bounch
	if (touch == self.RubyFirstTouch) {
		if(CGRectContainsPoint([animatingRuby1 boundingBox], location)){
			if(PulsatingAnimeRuby2 == NO &#38;&#38; PulsatingAnimeRuby3 == NO){
				[animatingRuby1 runAction:Repaction];
				PulsatingAnimeRuby1 = YES;

				[self ActivatedBricks:PulsatingAnimeRuby1];
			}
		}
		if(CGRectContainsPoint([animatingRuby2 boundingBox], location)){
			if(PulsatingAnimeRuby1 == NO &#38;&#38; PulsatingAnimeRuby3 == NO){
				[animatingRuby2 runAction:Repaction];
				PulsatingAnimeRuby2 = YES;

				[self ActivatedBricks:PulsatingAnimeRuby2];
			}
		}
		if(CGRectContainsPoint([animatingRuby3 boundingBox], location)){
			if(PulsatingAnimeRuby1 == NO &#38;&#38; PulsatingAnimeRuby2 == NO){
				[animatingRuby3 runAction:Repaction];
				PulsatingAnimeRuby3 = YES;

				[self ActivatedBricks:PulsatingAnimeRuby3];
			}
		}
	}
	//Else return the rubys to their original size and stop the action
	else if (touch == self.RubySecondTouch) {
		if(PulsatingAnimeRuby1 == YES){
			[animatingRuby1 stopAction:Repaction];             //This doesn&#39;t work
			[animatingRuby1 setScaleX:screenSize.width/12850.0f]; //This doesn&#39;t work
			[animatingRuby1 setScaleY:screenSize.height/9552.0f]; //This doesn&#39;t work
			PulsatingAnimeRuby1 = NO;                             //This works fine
			[self ActivatedBricks:PulsatingAnimeRuby1];           //This works fine
		}
		else if(PulsatingAnimeRuby2 == YES){
			[animatingRuby2 stopAction:Repaction];               //This doesn&#39;t work
			[animatingRuby2 setScaleX:screenSize.width/12850.0f]; //This doesn&#39;t work
			[animatingRuby2 setScaleY:screenSize.height/9552.0f]; //This doesn&#39;t work
			PulsatingAnimeRuby2 = NO;                             //This works fine
			[self ActivatedBricks:PulsatingAnimeRuby2];           //This works fine
		}
		else if(PulsatingAnimeRuby3 == YES){
			[animatingRuby3 stopAction:Repaction];                //This doesn&#39;t work
			[animatingRuby3 setScaleX:screenSize.width/12850.0f]; //This doesn&#39;t work
			[animatingRuby3 setScaleY:screenSize.height/9552.0f]; //This doesn&#39;t work
			PulsatingAnimeRuby3 = NO;                             //This works fine
			[self ActivatedBricks:PulsatingAnimeRuby3];           //This works fine
		}
	}

}</code></pre></description>
		</item>
		<item>
			<title>davidthecoder on "Jump button problem"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/21038#post-116921</link>
			<pubDate>Tue, 20 Sep 2011 03:43:49 +0000</pubDate>
			<dc:creator>davidthecoder</dc:creator>
			<guid isPermaLink="false">116921@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>i have a jump action that plays when the jump button is pressed, the only problem is that every time the button is pressed he jumps even if it is in the middle of playing out the action, so i guess I'm asking for a way to make sure the entire action has completed before it is called to play again?
</p></description>
		</item>
		<item>
			<title>vaskal08 on "Pausing actions instead of stopping"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/20457#post-113736</link>
			<pubDate>Wed, 31 Aug 2011 22:36:13 +0000</pubDate>
			<dc:creator>vaskal08</dc:creator>
			<guid isPermaLink="false">113736@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I wanted a moveTo action to happen faster and faster as time progressed, so what i did was i inserted a variable as the duration and a method called with a timer stopped the action, reduced the duration, then started up the action again. The problem i found with this was that when i started up the animation again the sprite was closer to its destination, and the duration was nearly the same as before, so the sprite got slower. is there a way to pause an action, and alter its properties instead of completely stopping it? i dont want to use ease actions because thats not what im looking for in terms of speeding up the sprite.
</p></description>
		</item>
		<item>
			<title>scottdurica on "Problem with CCAction"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/19975#post-111498</link>
			<pubDate>Fri, 19 Aug 2011 20:20:18 +0000</pubDate>
			<dc:creator>scottdurica</dc:creator>
			<guid isPermaLink="false">111498@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>In an effort to finish up my game, I've started changing out some of the 'mySprite.postion' calls with Actions.  However, I can't get Actions to run ANYWHERE in my code.  In an attempt to narrow down the possibilities of where I'm going wrong, I've tried to run actions at the most basic places in my code.  For example, I created a sprite and added it to the screen in the init method of my class GameLayer.  In my touchEnded method, I've set up a simple rotate action to run on the sprite when a certain button is touched.  Through breakpoints, I see that the touch is detected as expected, and the runAction method is called like it should be...but no rotation on the sprite...<br />
Like I said, I can't get actions to run anywhere in this program.. I set up a new project, added the sprite the same way and called the action the same way(on touchEnded), and the sprite rotates!  It's making me crazy!  </p>
<p>Any ideas are greatly appreciated.</p>
<p>I'll post the code below.  </p>
<p>Why does this action work?????(this is the generic project I set up just to test the action)<br />
<pre><code>-(id) init
{
	// always call &#34;super&#34; init
	// Apple recommends to re-assign &#34;self&#34; with the &#34;super&#34; return value
	if( (self=[super init])) {

		// create and initialize a Label
		label = [CCLabelTTF labelWithString:@&#34;Hello World&#34; fontName:@&#34;Marker Felt&#34; fontSize:64];

		// ask director the the window size
		CGSize size = [[CCDirector sharedDirector] winSize];

		// position the label on the center of the screen
		label.position =  ccp( size.width /2 , size.height/2 );

		// add the label as a child to this Layer
		[self addChild: label];

        [[CCTouchDispatcher sharedDispatcher]addTargetedDelegate:self priority:0 swallowsTouches:YES];
	}
	return self;
}

-(BOOL)ccTouchBegan:(UITouch *)touch withEvent:(UIEvent *)event{
    return YES;
}
-(void)ccTouchEnded:(UITouch *)touch withEvent:(UIEvent *)event{
    id rotateAction = [CCRotateBy actionWithDuration:0.5f angle:60];
    [label runAction:rotateAction];
}</code></pre>
<p>but this does not!!</p>
<pre><code>-(id) init
{
	// always call &#34;super&#34; init
	// Apple recommends to re-assign &#34;self&#34; with the &#34;super&#34; return value
	if( (self=[super init])) {

		testSprite = [CCSprite spriteWithFile:@&#34;card_back.png&#34;];

        winSize = [[CCDirector sharedDirector] winSize];

		testSprite.position =  ccp( winSize.width /2 , winSize.height/2 );

		// add the label as a child to this Layer
		[self addChild: testSprite z:10 tag:0];

        gameObject = [[GameBoard alloc]init];

        [gameObject updateGameState: kGameStateGameUninitialized];

        [self addChild:gameObject];

	}
	return self;
}</code></pre>
<p>in the ccTouchEnded method....</p>
<pre><code>if (CGRectContainsPoint([gameObject getDumpButtonRect], touchLocation) ) {
        CCLOG(@&#34;dump button was hit&#34;);
        id rotateAction = [CCRotateBy actionWithDuration:0.5 angle:60];

        [testSprite runAction:rotateAction];

//        [gameObject dumpCardsFromHand];

    }</code></pre></description>
		</item>
		<item>
			<title>scottdurica on "CCActions problem"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/19743#post-110564</link>
			<pubDate>Sat, 13 Aug 2011 21:24:29 +0000</pubDate>
			<dc:creator>scottdurica</dc:creator>
			<guid isPermaLink="false">110564@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>This is probably a really stupid oversight on my part, but if someone can help me see it I'd really appreciate it.  I've been staring at this problem for a while now can't come up with the answer.</p>
<p>I've used actions before and had no problems, but for some reason I'm having a problem getting ANY actions to work in the game I'm working on.  I'll post the same method twice below...The first one simply calls sprite.position to move the sprites, and it moves them as expected.</p>
<p>The second one omits the sprite.position call and creates an action to move the sprites instead...but my sprites go NOWHERE!  Anyone see why??</p>
<p>I don't see why it would matter, since anything you can do with a sprite you should also be able to do on a sprite in a SpriteBatchNode, but I will disclose that the sprites I'm trying to move with actions are in a batch node.</p>
<p>Thanks in advance for any ideas..</p>
<p>This moves the sprites as expected.....</p>
<pre><code>-(void)dumpCardsFromHand{
    for (int i=0; i&#60;8; i++) {
        int tagNum = [(Card*)[playerOneHand.playerOneHandArray objectAtIndex:i]valueAsTagNumber];
        sprite = (CCSprite*)[spriteBatchNode getChildByTag:tagNum];

//        CCAction *move = [CCMoveTo actionWithDuration:1.0f position:ccp(50,20)];
//
//        [sprite runAction:move];

        sprite.position = ccp(50,20);

        [playerOneHand.playerOneHandArray replaceObjectAtIndex:i withObject:[NSNull null]];
    }
}</code></pre>
<p>This doesn't move anything.....</p>
<pre><code>-(void)dumpCardsFromHand{
    for (int i=0; i&#60;8; i++) {
        int tagNum = [(Card*)[playerOneHand.playerOneHandArray objectAtIndex:i]valueAsTagNumber];
        sprite = (CCSprite*)[spriteBatchNode getChildByTag:tagNum];

        CCAction *move = [CCMoveTo actionWithDuration:1.0f position:ccp(50,20)];

        [sprite runAction:move];

//        sprite.position = ccp(50,20);

        [playerOneHand.playerOneHandArray replaceObjectAtIndex:i withObject:[NSNull null]];
    }
}</code></pre></description>
		</item>
		<item>
			<title>XRayCharlie on "Spawning multiple repeatForever actions with different periods"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/19599#post-109615</link>
			<pubDate>Tue, 09 Aug 2011 14:24:13 +0000</pubDate>
			<dc:creator>XRayCharlie</dc:creator>
			<guid isPermaLink="false">109615@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>hello,</p>
<p>I have a banner that I want to both rotate and scale and have it repeat forever.  I want to have the rotation action at a different period than the scale action so the banner doesn't look like it is following the same path over and over again.</p>
<p>I can get it to work if both the scale and rotation action durations are the same and if they are not then the one action will stop and wait for the other to complete before repeating.</p>
<p>I have also tried adding the CCRepeatForever to the CCSpawn actions which does not work.</p>
<p>Any ideas of how to do this would be appreciated.</p>
<p>Regards,</p>
<p>id rotAction = [CCRotateBy actionWithDuration:2.0 angle:40];<br />
		id rotEaseAction = [CCEaseSineInOut actionWithAction:rotAction];<br />
		id rotSequence = [CCSequence actions: [[rotEaseAction copy] autorelease],[rotEaseAction reverse], nil];</p>
<p>		id scaleToAction = [CCScaleTo actionWithDuration: 2.0 scale: 2.0f];<br />
		id scaleFromAction = [CCScaleTo actionWithDuration: 2.0 scale: 1.0f];<br />
		id scaleSequence = [CCSequence actions: scaleToAction, scaleFromAction, nil];</p>
<p>		id actionAll = [CCSpawn actions: rotSequence,  scaleSequence, nil];</p>
<p>		id actionRepeat = [CCRepeatForever actionWithAction:actionAll];</p>
<p>		[banner runAction:actionRepeat];
</p></description>
		</item>
		<item>
			<title>gabapenteado on "Problems with repeating function calls"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/19610#post-109694</link>
			<pubDate>Tue, 09 Aug 2011 19:39:18 +0000</pubDate>
			<dc:creator>gabapenteado</dc:creator>
			<guid isPermaLink="false">109694@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hey guys, new guy here, so probably rookie mistake. I searched the forums and couldn't find a solution for my problem</p>
<p>So here's the problem, i have a CCSequence containing a wait (CCDelayTime) and a function call (CCCallFunc), and i put this sequence on a repeat forever so it can keep calling the function on the interval needed. What happens is the following: first function call goes ok, but at the second time the function is called, it produces the following error <strong>(*** Assertion failure in -[CCScheduler scheduleUpdateForTarget:priority:paused:], /Users/gabriel.penteado/Desktop/zaxcf/zaxcf/libs/cocos2d/CCScheduler.m:395)</strong><br />
and gets called TWICE, and then THREE times(two errors), and then four... The app NEVER crashes.</p>
<p>code for my class:<br />
<pre><code>//
//  BuildingLayer.m
//  zaxcf
//
//  Created by Gabriel Penteado on 8/5/11.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#<a href='http://www.cocos2d-iphone.org/forum/tags/import'>import</a> &#34;BuildingLayer.h&#34;

@implementation BuildingLayer

-(void) Awake:(NSString *)pAtlasName
{
    [super Awake:pAtlasName];
    inactiveBuildings = [[NSMutableArray alloc] initWithCapacity:0];
}

-(void) Start
{
    [super Start];

    CCMoveBy* waitAction = [CCDelayTime actionWithDuration:3.0f];
    CCCallFunc* functionAction = [CCCallFuncO actionWithTarget:self selector:@selector(CreateBuilding)];
    CCSequence* compositeAction = [CCSequence actions:waitAction, functionAction, nil];

    [self runAction:[CCRepeatForever actionWithAction:compositeAction]];
}

-(void)removeChild:(InsaneSprite *)node cleanup:(BOOL)cleanup
{
    [super removeChild:node cleanup:NO];
    [inactiveBuildings addObject:node];
}

-(Building*) CreateBuildingOfType:(NSString*)pType
{
    Building* newBuild;
    if([inactiveBuildings count] == 0)
    {
        NSLog(@&#34;nova!&#34;);
        newBuild = [Building spriteWithSpriteFrameName:pType];
        [newBuild AwakeWithSheet:self];
    }else
    {
        NSLog(@&#34;reusando!&#34;);
        newBuild = [inactiveBuildings objectAtIndex:0];
        [newBuild SetFrame:pType];
        [inactiveBuildings removeObject:newBuild];
    }

    return newBuild;
}

-(void) CreateBuilding
{
    NSLog(@&#34;loggando&#34;);
    Building* _building;
    int dice = rand()%3;
    NSLog(@&#34;-----CREATE BUILDING-----&#34;);
    switch (dice)
    {
        case 0:
            _building = [self CreateBuildingOfType:@&#34;building1&#34;];
        break;
        case 1:
            _building = [self CreateBuildingOfType:@&#34;building2&#34;];
        break;
        case 2:
            _building = [self CreateBuildingOfType:@&#34;building3&#34;];
        break;
    }
    [self addChild:_building];
    [_building Start];

    //NOT REPEATING AND USING THIS CODE PRODUCES THE SAME RESULT
    //[self stopAllActions];

    /*CCMoveBy* waitAction = [CCDelayTime actionWithDuration:3.0f];
    CCCallFunc* functionAction = [CCCallFunc actionWithTarget:self selector:@selector(CreateBuilding)];
    CCSequence* compositeAction = [CCSequence actions:waitAction, functionAction, nil];

    [self runAction:compositeAction];*/
}

@end</code></pre>
<p>This class extends CCNode, and is placed on stage AFTER the awake call, but BEFORE the Start call.</p>
<p>Am i using functions wrong? have i mixed something i shouldn't? Thanks in advance for all the help guys.
</p></description>
		</item>
		<item>
			<title>davidthecoder on "two actions at once?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/18770#post-105335</link>
			<pubDate>Sat, 16 Jul 2011 18:54:46 +0000</pubDate>
			<dc:creator>davidthecoder</dc:creator>
			<guid isPermaLink="false">105335@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>hey i was wondering if anybody could show me how to run two actions on one sprite.<br />
i get confused easily so i was hoping for a code snippet for an example with an explanation if that isn't to much to ask for?</p>
<p>i have a sprite that moves across the bottom of the screen continuously, i want the sprite to move up a little bit and then stop there, but i don't want the sprite to stop moving across the screen. :) thanks if you help me.
</p></description>
		</item>
		<item>
			<title>albatross on "CCBitmapFontAtlas and disappearing actions!"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/5790#post-34479</link>
			<pubDate>Sun, 18 Apr 2010 11:04:48 +0000</pubDate>
			<dc:creator>albatross</dc:creator>
			<guid isPermaLink="false">34479@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hi,</p>
<p>I am not sure if this is a bug or if I'm doing something completely wrong here. I quickly wrote a small test to illustrate it, just paste it in the AtlasTest.m in the cocos2d project to test it out.</p>
<p>The problem is that the elastic action is not running after being run for the first time. I've tried a number of different ways in order to get it to work. If I don't preload the CCBitmapFontAtlases then it runs just fine, but not on an iphone 2g! :' - ( I've read that there's not supposed to be any overhead creating a CCBitmapFontAtlas, but it seems to drag performance down on the iphone 2g, which it doesn't if I preload them.</p>
<p>I'm running v0.99.1.</p>
<p>Please help me! :)</p>
<pre><code>@interface AtlasActionTest : AtlasDemo
{
	NSMutableArray *a;
	NSMutableArray *b;
}

-(void) removeLabel:(id)sender;

@end

@implementation AtlasActionTest
-(id) init
{
	if( (self=[super init]) ) {
		a = [[NSMutableArray alloc] init];
		b = [[NSMutableArray alloc] init];

		CGSize s = [[CCDirector sharedDirector] winSize];

		for (uint i = 0; i &#60; 5; i++) {
			CCBitmapFontAtlas *label = [CCBitmapFontAtlas bitmapFontAtlasWithString:[NSString stringWithFormat:@&#34;%d&#34;, i]
																			fntFile:@&#34;bitmapFontTest.fnt&#34;];
			[label setPosition: ccp(s.width/2, s.height/2)];
			[label setAnchorPoint: ccp(0.5f, 0.5f)];
			[label setScale:0.f];
			[a addObject:label];
			id scale = [CCScaleTo actionWithDuration:0.8f scale:1.f];
			id elastic = [CCEaseElasticInOut actionWithAction:scale];
			id fadeOut = [CCSpawn actionOne:[CCFadeOut actionWithDuration:0.8f]
										two:[CCMoveBy actionWithDuration:0.8f position:ccp(0.f,15.f)]];
			id action = [CCSequence actions:elastic,
						 fadeOut,
						 [CCCallFuncN actionWithTarget:self selector:@selector(removeLabel:)], nil];

			[b addObject:action];
		}

		[self schedule:@selector(step:) interval:1.f];
	}

	return self;
}

-(void) removeLabel:(id)sender {
	[self removeChild:(CCNode *)sender cleanup:NO];
}

-(void) step:(ccTime) dt
{
	CGSize s = [[CCDirector sharedDirector] winSize];
	for (CCBitmapFontAtlas *label in a) {
		if (![[self children] containsObject:label]) {
			[self addChild:label];
			[label runAction:[b objectAtIndex:[a indexOfObject:label]]];
			break;
		}
	}
}

-(NSString*) title
{
	return @&#34;AtlasActionTest&#34;;
}

-(NSString *) subtitle
{
	return @&#34;Testing actions!&#34;;
}

-(void) dealloc {
	[a release];
	[b release];
	[super dealloc];
}

@end</code></pre></description>
		</item>
		<item>
			<title>napierzaza on "Cocos2D Actions"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/7419#post-43502</link>
			<pubDate>Sat, 26 Jun 2010 02:56:31 +0000</pubDate>
			<dc:creator>napierzaza</dc:creator>
			<guid isPermaLink="false">43502@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Okay. This is a suggestion for the actions in Cocos2D. I wish I was capable enough to make a submittable patch. But hopefully my idea is enough for someone more capable.</p>
<p>Problem:<br />
Multiple actions are monolithic. They're all packed together into Spawn or a Sequence, and they cannot be modified afterwards. You can poke them somewhat deep, but it gets very hairy very quick and in practice it doesn't work.</p>
<p>Problem2:<br />
You can't modify an action once it is created. There should feasibly be a way to modify the action and have it recalculate no? This would be an issue if you had a sprite moving and it had to slow down as it moved. It's rather complicated to have to stop the move action (actually, all actions) and totally reinitialize at a different speed. </p>
<p>Solution:<br />
So, the solution is of course to have all of the actions more accessible. You can ask a sprite (for this example) and see if they are doing a move, or a opacity or a scale action. Since they are operate independently you can stop actions of a specific type if you want without affecting the other actions. </p>
<p>I think Apple has a very interesting method for this. Has anyone seen the WWDC video for Core Animation? In "Core animation in Practice part 1" at about 35 minutes in they go over animations. The way they manage it is that the object has a dictionary of its active actions. So, if you put "MoveTo on the y axis" while it's already moving, it will replace that action and not interrupt the other actions. So you need to have a dictionary that manages all those different possible actions. No Spawn required, the action dictionary is the Spawn.</p>
<p>I realize that it's an issue when you get to Sequences. I use them all the time too. I suppose the best thing to do is just have the callback linked to the completion of an action. When that action finishes, it pops that new action from the sequence into the action dictionary. </p>
<p>For the Apple solution, you actually have to name the action with a string. It's not necessary, but it gets the job done (?).
</p></description>
		</item>
		<item>
			<title>pavel.krusek on "Callback and Spawn actions"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/18055#post-101298</link>
			<pubDate>Mon, 27 Jun 2011 10:26:23 +0000</pubDate>
			<dc:creator>pavel.krusek</dc:creator>
			<guid isPermaLink="false">101298@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hi guys,</p>
<p>is there a posibility to call callback function CCCallFunc with Spawn actions?<br />
Sequence actions are no problem with callback, of course.</p>
<p>thanks
</p></description>
		</item>
		<item>
			<title>daemonk on "NSMutableArray as sequence actions parameter"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/2547#post-15881</link>
			<pubDate>Mon, 19 Oct 2009 07:09:39 +0000</pubDate>
			<dc:creator>daemonk</dc:creator>
			<guid isPermaLink="false">15881@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Seems like there was a lot of posts asking how to add actions to a sequence dynamically. So I wrote a function that you can add to IntervalAction.m and header that'll take a NSMutableArray of actions as the parameter:</p>
<pre><code>+(id) actionMutableArray: (NSMutableArray*) _actionList {
	FiniteTimeAction *now;
	FiniteTimeAction *prev = [_actionList objectAtIndex:0];

	for (int i = 1 ; i &#60; [_actionList count] ; i++) {
		now = [_actionList objectAtIndex:i];
		prev = [Sequence actionOne: prev two: now];
	}

	return prev;
}</code></pre>
<p>So to use this, just create an NSMutableArray of actions that you want sequenced, then pass it to the actionMutableArray function.</p>
<pre><code>NSMutableArray* actionList = [[NSMutableArray alloc] initWithCapacity:1];
[actionList addObject:yourActionOne];
[actionList addObject:yourActionTwo];
[actionList addObject:yourActionThree];

[yourSprite runAction:[Sequence actionMutableArray:actionList]];</code></pre>
<p>This seems to run faster than using:<br />
<pre><code>-(id) addAction:(id) _action ToSequence:(id) _seq {
	return [Sequence actions: _seq, _action, nil];
}</code></pre></description>
		</item>
		<item>
			<title>dgtheman on "CGRectContainsPoint not returning true if sprite is scaled?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/17290#post-97318</link>
			<pubDate>Sun, 05 Jun 2011 09:42:03 +0000</pubDate>
			<dc:creator>dgtheman</dc:creator>
			<guid isPermaLink="false">97318@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I have a CCSprite called sprite. This is the BOOL for checking if the user touched the sprite.<br />
BOOL touchedCard = CGRectContainsPoint([sprite boundingBox], locationTouched);<br />
Everything works but when the sprite is scaled by 0.4 (pretty much becomes smaller) and moved to a different positon the touchedCard returns false no matter what even if the user touches the sprite. However, if only one of the actions occurs (such as only move or only scale), then it works.  Anyone know how to fix this? Thanks in advance.<br />
Extra Info:<br />
When the sprite is scaled AND moved it is very small, but when it is only scaled or only moved it is regular size. Again it works if only one action occurs. Thus, I believe it is something with the bounding box being to small to recognize (just an idea not sure thats why Im asking).
</p></description>
		</item>
		<item>
			<title>lummis on "Is it possible to get the names and values of all properties of an object?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/16510#post-93076</link>
			<pubDate>Fri, 13 May 2011 02:39:55 +0000</pubDate>
			<dc:creator>lummis</dc:creator>
			<guid isPermaLink="false">93076@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Including inherited properties?
</p></description>
		</item>
		<item>
			<title>AnandMMundewadi on "fade In and fade Out Animation for sprite"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/16257#post-91666</link>
			<pubDate>Thu, 05 May 2011 07:11:34 +0000</pubDate>
			<dc:creator>AnandMMundewadi</dc:creator>
			<guid isPermaLink="false">91666@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hi All,</p>
<p>Hey i want to do fade in and fade out animation for sprite so that suggest me how i is to make it out.....</p>
<p>but i don't want transitions i want Animation</p>
<p>Regards </p>
<p>Anand
</p></description>
		</item>
		<item>
			<title>bipolarpants on "Moving Two Sprites in Two Different Directions At the Same Time?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/16144#post-91040</link>
			<pubDate>Sun, 01 May 2011 21:48:21 +0000</pubDate>
			<dc:creator>bipolarpants</dc:creator>
			<guid isPermaLink="false">91040@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>So this is probably a pretty basic question, but how do I move two sprites at the same time? I was using touchesbegan to move them originally and it worked just fine, but the I realized they can't be moved at the same time, only one at a time. Any suggestions? thanks!
</p></description>
		</item>
		<item>
			<title>e1234 on "CCSpawn not working"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/16114#post-90840</link>
			<pubDate>Sat, 30 Apr 2011 08:16:21 +0000</pubDate>
			<dc:creator>e1234</dc:creator>
			<guid isPermaLink="false">90840@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hi,</p>
<p>Why would the following code not execute in parallel, it only processes action1 not action3?</p>
<p>        jumpUpAction = [CC3MoveBy actionWithDuration: 2.5 moveBy: cc3v(20.0,0.0,0.0)];<br />
	jumpDownAction =[CC3MoveBy actionWithDuration: 2.5 moveBy: cc3v(-20.0,0.0,0.0)];<br />
	moveAction = [CC3MoveBy actionWithDuration: 2.5 moveBy: cc3v(0.0,0.0, -10.0)];</p>
<p>	action1 = [CCSequence actions: jumpUpAction, jumpDownAction, nil];</p>
<p>	id action3 = [CCSpawn actions: moveAction, action1, nil];</p>
<p>	[[self getNodeNamed: @"SpaceShip"] runAction: action3];</p>
<p>Thanks,<br />
Etienne
</p></description>
		</item>
		<item>
			<title>tinman2020 on "Custom effect update interval"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/15753#post-89101</link>
			<pubDate>Wed, 20 Apr 2011 05:43:11 +0000</pubDate>
			<dc:creator>tinman2020</dc:creator>
			<guid isPermaLink="false">89101@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hello all,</p>
<p>I have created my own effect in CCACtionGrid3D called TSRipple, it is mirrored almost exactly after the CCRipple3D effect but the ripple algorithm is modified so ripples propagate like water, etc. I did this so I would have all the same conveniences of the other Cocos2d effects, including timers and RepeatForever actions, etc. My issue is that I actually need to slow the effect down, but dont want to do so by increasing the grid size. I dont see a param for how frequently the 'update:(ccTime)time' method gets called in these CCActions. How can I modify the scheduler to slow this effect down?
</p></description>
		</item>
		<item>
			<title>horseshoe7 on "CCActions - Action Queue"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/15252#post-86557</link>
			<pubDate>Mon, 04 Apr 2011 17:03:28 +0000</pubDate>
			<dc:creator>horseshoe7</dc:creator>
			<guid isPermaLink="false">86557@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>In this post I refer to actions, but I mean CCActionInterval objects.</p>
<p>It would be nice if there was some sort of queue for action sequences instead of having to construct them before you want to run them.  This way you can dynamically add and remove actions from a queue, depending on what's happening at runtime.</p>
<p>Likewise, it would be cool if you could derive an action from a stopped action, so that you could tell an action to create a new instance of itself, which represents what is "left over" or "what is still remaining to be run".  i.e. it creates an action from _elapsed to _duration.  This isn't such a big deal with CCMoveTo actions, because you can still give the same end point and duration is just the original action's duration - elapsed_ but moveBy actions might not be so straightforward?  Maybe this is the kind of thing others should also express interest in.</p>
<p>This is a community and I'd like to contribute where I can.  I hope I can prototype this in the next few weeks when I have time.  I admit I'm not the most experienced coder.</p>
<p>If this is just an implementation thing, that just requires a bit of playing with the existing code, then whoever knows how to do this / has done it, it would be great if some "recipes" could exist in the programming guide for the less experienced coders to make use of.
</p></description>
		</item>
		<item>
			<title>horseshoe7 on "CCActions - Re-initialize"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/14711#post-83512</link>
			<pubDate>Sun, 20 Mar 2011 10:06:07 +0000</pubDate>
			<dc:creator>horseshoe7</dc:creator>
			<guid isPermaLink="false">83512@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Actions have always been a bit problematic, especially if you have to start/stop/restart them.</p>
<p>In the best practices guide it suggests one should call the init method on them again to reset them.  This instantly sounds like bad practice, since init methods are like constructors.  And then you don't really know what's happening from a memory standpoint</p>
<p>Could the API be updated (at least for CCActionIntervals) to have a reinit method (where you can set your duration and target values new) ?
</p></description>
		</item>

	</channel>
</rss>

