<?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; Topic: Ability to embed RepeatForever in an action sequence</title>
		<link>http://www.cocos2d-iphone.org/forum/topic/2141</link>
		<description>A fast, easy to use, free, and community supported 2D game engine</description>
		<language>en-US</language>
		<pubDate>Fri, 10 Feb 2012 01:50:02 +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/topic/2141" rel="self" type="application/rss+xml" />

		<item>
			<title>iisystems on "Ability to embed RepeatForever in an action sequence"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/2141#post-13610</link>
			<pubDate>Mon, 28 Sep 2009 13:38:32 +0000</pubDate>
			<dc:creator>iisystems</dc:creator>
			<guid isPermaLink="false">13610@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Kahless,</p>
<p>Thanks for the pointer.  This guide wasn't available when I started my game (embarrassing how long ago this was now!)  Do you have suggestions aside from a timer and callback on how to run a finite action followed by a RepeatForever action?</p>
<p>Thanks again,<br />
Scott
</p></description>
		</item>
		<item>
			<title>Kahless on "Ability to embed RepeatForever in an action sequence"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/2141#post-13446</link>
			<pubDate>Sat, 26 Sep 2009 22:28:54 +0000</pubDate>
			<dc:creator>Kahless</dc:creator>
			<guid isPermaLink="false">13446@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I do not think what you are trying to do is possible.</p>
<p><a href="http://www.cocos2d-iphone.org/wiki/doku.php/prog_guide:actions_composition" rel="nofollow">http://www.cocos2d-iphone.org/wiki/doku.php/prog_guide:actions_composition</a></p>
<p>*IMPORTANT:* The inner actions should have a non infinity time (eg: You can't add a RepeatForever action in a Sequence action).
</p></description>
		</item>
		<item>
			<title>iisystems on "Ability to embed RepeatForever in an action sequence"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/2141#post-13444</link>
			<pubDate>Sat, 26 Sep 2009 21:41:25 +0000</pubDate>
			<dc:creator>iisystems</dc:creator>
			<guid isPermaLink="false">13444@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hi all-- looking for insight on this...</p>
<p>I'm getting a crash when I try to embed RepeatForever in an action.  Using RepeatForever as follows works fine:</p>
<p>				`id currentMovementAnimation = [RepeatForever actionWithAction: [Sequence actions:actionOneWay,<br />
																 [DelayTime actionWithDuration:ani-&#62;delay],<br />
																 actionScale,<br />
																 [actionOneWay reverse],<br />
																 [DelayTime actionWithDuration:ani-&#62;delay],<br />
																 [actionScale reverse],<br />
																 nil]];<br />
                               [self runAction:currentMovementAnimation];	// Run the movement animation`</p>
<p>However, I want to make an intro animation followed by the RepeatForever.  For this, i tried (and failed) with:</p>
<p>				`id mainAnimation = [RepeatForever actionWithAction: [Sequence actions:actionOneWay,<br />
																 [DelayTime actionWithDuration:ani-&#62;delay],<br />
																 actionScale,<br />
																 [actionOneWay reverse],<br />
																 [DelayTime actionWithDuration:ani-&#62;delay],<br />
																 [actionScale reverse],<br />
																 nil]];<br />
				id actionWalk = [MoveBy actionWithDuration:[self getAnimationDuration:ani] position:ccp(intro-&#62;to.x - intro-&#62;from.x, intro-&#62;to.y - intro-&#62;from.y)];<br />
				id actionJump = [MoveBy actionWithDuration:[self getAnimationDuration:ani] position:ccp(ani-&#62;from.x - intro-&#62;to.x, ani-&#62;from.y - intro-&#62;to.y)];<br />
             			id currentMovementAnimation = [Sequence actions:actionWalk,<br />
												[DelayTime actionWithDuration:ani-&#62;delay],<br />
												actionJump,<br />
												mainAnimation,<br />
												nil];<br />
                               [self runAction:currentMovementAnimation];	// Run the movement animation`</p>
<p>I can understand logically that if you put RepeatForever in a sequence that the rest of the sequence will not execute.  However, it seems we should have the ability to use this as the last step in a compound animation.  I would even argue that it should be allowed anywhere in the animation, with the understanding that none of the subsequent actions will execute.  Certainly, it shouldn't crash?</p>
<p>Can anyone chime in on this?</p>
<p>Thanks,<br />
Scott
</p></description>
		</item>

	</channel>
</rss>

