<?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: loops - Recent Topics</title>
		<link>http://www.cocos2d-iphone.org/forum/tags/loops</link>
		<description>A fast, easy to use, free, and community supported 2D game engine</description>
		<language>en-US</language>
		<pubDate>Fri, 10 Feb 2012 03:50:13 +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/loops/topics" rel="self" type="application/rss+xml" />

		<item>
			<title>cesarvargas00 on "I need some help making this game. Game Loops, Events."</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/15863#post-89596</link>
			<pubDate>Sat, 23 Apr 2011 13:16:10 +0000</pubDate>
			<dc:creator>cesarvargas00</dc:creator>
			<guid isPermaLink="false">89596@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hi!<br />
Im a complete beginner when it comes to programming OO and game making.</p>
<p>This is the game im trying to make: It`s about a forest and an explorer. He has to cross the forest without dying.<br />
<a href="https://github.com/cesarvargas00/NoSoEnchantedForest" rel="nofollow">https://github.com/cesarvargas00/NoSoEnchantedForest</a> &#60;&#60;&#60; SourceCode</p>
<p>This game is just for me to learn... The problem is that i`m stuck on some stuff...</p>
<p>What I want to do: When i push left cursor on the keyboard the explorer has to go left.<br />
How can I do that? I heard about game loops and events. but i`m not sure how they work.</p>
<p>Thank you for your time!</p>
<p>Cesar
</p></description>
		</item>
		<item>
			<title>ruben301 on "Access variables of objects created in loops?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/12405#post-69805</link>
			<pubDate>Thu, 06 Jan 2011 22:30:24 +0000</pubDate>
			<dc:creator>ruben301</dc:creator>
			<guid isPermaLink="false">69805@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>When i have created say like 500 objects in a for loop, how can i later acces these objects variables like postition and others. The problem is that all the objects (infact cpshapes) have the same variable name.</p>
<p>Thanks in advance!
</p></description>
		</item>
		<item>
			<title>MandarX on "two loops"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/7680#post-44943</link>
			<pubDate>Tue, 06 Jul 2010 09:07:13 +0000</pubDate>
			<dc:creator>MandarX</dc:creator>
			<guid isPermaLink="false">44943@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hello, I hope it's not a FAQ...</p>
<p>is it possible to play two loops at the same time?</p>
<p>thanks</p>
<p>MandarX
</p></description>
		</item>
		<item>
			<title>G-Ram on "Weird Loops and Cocos2d"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/8780#post-50856</link>
			<pubDate>Tue, 17 Aug 2010 13:10:53 +0000</pubDate>
			<dc:creator>G-Ram</dc:creator>
			<guid isPermaLink="false">50856@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I really love cocos2d and everything has worked out perfectly until now. I am making a game using runtime procedural generation and every time the step function is called I run loops, going through each of my arrayed sprites. This has worked fine, but when I added in a loop call which was based on time(doe below) the loop runs and adds the explosion, but then does not remove the sprite or tile(subclass of CCSprite, which includes CCSprite, cpShape, cpBody ). The weird thing about this is it will let me run other functions on the tile, such as repositioning it, but won't let me remove it. Sometimes it gives me the error that I am removing the chipmunk static shape twice. When I remove this, however, it still quits on the "[self removeChild: tile.sprite...];. I would appreciate any help.<br />
Here is the code:<br />
	for (Tile *tile in BridgeBuilder) {<br />
		if (snazzy.position.x+160 &#62;= tile.sprite.position.x &#38;&#38; snazzy.position.x+120 &#60;= tile.sprite.position.x) {<br />
			for (CCSprite *sprite in DynamiteBuilder) {<br />
				if (sprite.position.x == tile.sprite.position.x) {<br />
					int timeremove = (arc4random()%4+1);<br />
					int delaytimeremove = timeremove*4;<br />
					x1 = tile.sprite.position.x;<br />
					CCAnimation * animation2 = [[CCAnimation alloc] initWithName:@"Explode" delay:timeremove/6.0];<br />
					for ( int n=1; n &#60; 5; ++n )<br />
					{<br />
						NSString * fname2 = [NSString stringWithFormat:@"Explosion%i.png", n];<br />
						[animation2 addFrame:[explosioncache spriteFrameByName: fname2]];<br />
					}<br />
//I have tried CCCallFunc and it leaves me with the same result<br />
					id explosionAnimo = [CCSequence actions: [CCSpawn actions:[CCAnimate actionWithAnimation:animation2],<br />
															  [CCDelayTime actionWithDuration:delaytimeremove/6.0], nil],<br />
										 //[CCSpawn actions:[CCCallFunc actionWithTarget:self selector:@selector(explosion:)],<br />
										 //[CCCallFunc actionWithTarget:self selector:@selector(Dynamiteexplosion:)],nil],<br />
										 nil];<br />
					[sprite runAction:explosionAnimo];<br />
					[self performSelector:@selector(explosion:) withObject:nil afterDelay:delaytimeremove/6.0];<br />
				}<br />
			}<br />
		}<br />
	}<br />
Then it calls this function:<br />
//It would really helpful if someone could show my a how to make a function that removes and sprite when called.<br />
-(void)explosion:(id)sender{<br />
	for (Tile *tile1 in BridgeBuilder) {<br />
		if (tile1.sprite.position.x == x1) {<br />
			CCParticleExplosion *explosion = [CCParticleExplosion node];<br />
			explosion.position = cpv(x1,tile1.sprite.position.y+60);<br />
			explosion.gravity = cpv(0, -300);<br />
			[self addChild:explosion];<br />
			cpSpaceRemoveStaticShape(space, tile1.shape);<br />
			cpShapeFree(tile1.shape);<br />
			[BuildingBuilder removeObjectAtIndex:0];<br />
			[self removeChild: tile1.sprite cleanup:YES];<br />
			[tile1 release];<br />
		}<br />
	}<br />
	for (CCSprite *sprite1 in DynamiteBuilder){<br />
		if (sprite1.position.x == x1) {<br />
			[DynamiteBuilder removeObjectAtIndex:0];<br />
			[self removeChild:sprite1 cleanup:YES];<br />
		}<br />
	}<br />
}<br />
Thanks,
</p></description>
		</item>
		<item>
			<title>Fedcis on "Need Music for your Game?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/7642#post-44754</link>
			<pubDate>Mon, 05 Jul 2010 02:34:01 +0000</pubDate>
			<dc:creator>Fedcis</dc:creator>
			<guid isPermaLink="false">44754@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hi. If your looking for great music for your next game, please let us help. We offer original prearranged loops for $1.99 per track, with unlimited use in your game projects as long as you guarantee us credit in your release. If you want an original composition, please contact PM us for details. Prices range from $25 - $50 per original composition.
</p></description>
		</item>
		<item>
			<title>Tim Knauf on "[Game] Zoo Lasso"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/3125#post-19265</link>
			<pubDate>Mon, 23 Nov 2009 01:39:40 +0000</pubDate>
			<dc:creator>Tim Knauf</dc:creator>
			<guid isPermaLink="false">19265@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p><strong>Introducing Zoo Lasso</strong></p>
<p>We're proud to present Zoo Lasso, our first iPhone game. It's scheduled for App Store release on <strong>November the 25th</strong>.</p>
<p><a href="http://www.youtube.com/watch?v=a66BxcNWKnw&#038;feature=player_embedded" rel="nofollow">http://www.youtube.com/watch?v=a66BxcNWKnw&#038;feature=player_embedded</a></p>
<p><strong>A bit about the game:</strong></p>
<ul>
<li>It's an action puzzler with a 'score attack' focus based on combos.</li>
<li>As far as we're aware, it offers a new style of gameplay with its 'shape-drawing' mechanic.</li>
<li>You make progress by drawing loops around single species...</li>
<li>...but rack up big points with figure-eights, clover-leaves and other shapes around <em>multiple</em> species.</li>
<li>Includes OpenFeint leaderboards and an in-game high score system.</li>
<li>We intend to progressively add features over time: OpenFeint achievements, theme packs and new game modes (we're particularly interested in a two-player mode).</li>
</ul>
<p>More information can be found on our site: <a href="http://launchingpadgames.com/games/zoo-lasso">launchingpadgames.com/zoo-lasso</a></p>
<p>App store page (from November 25th on): <a href="http://itunes.com/apps/ZooLasso">itunes.com/apps/ZooLasso</a></p>
<p><strong>Screenshots</strong><br />
<a href="http://launchingpadgames.com/game_images/0000/0094/screenshot-1.jpg"><img src="http://launchingpadgames.com/game_images/0000/0094/screenshot-1_thumb.jpg" /></a></p>
<p><a href="http://launchingpadgames.com/game_images/0000/0096/screenshot-2.jpg"><img src="http://launchingpadgames.com/game_images/0000/0096/screenshot-2_thumb.jpg" /></a></p>
<p><a href="http://launchingpadgames.com/game_images/0000/0098/screenshot-3.jpg"><img src="http://launchingpadgames.com/game_images/0000/0098/screenshot-3_thumb.jpg" /></a></p>
<p><a href="http://launchingpadgames.com/game_images/0000/0100/screenshot-4.jpg"><img src="http://launchingpadgames.com/game_images/0000/0100/screenshot-4_thumb.jpg" /></a></p>
<p><a href="http://launchingpadgames.com/game_images/0000/0104/screenshot-5.jpg"><img src="http://launchingpadgames.com/game_images/0000/0104/screenshot-5_thumb.jpg" /></a></p>
<p><strong>Thank you!</strong></p>
<p>Launching Pad Games is composed of just two people, so there's no way we could have done this without cocos2d. Huge thanks go to the community and especially to Riq and the other principal developers. We'd definitely like to give back to the project as soon as we can (both financially and with hints-and-tips articles etc).</p>
<p>Let us know what you think of the game! If anyone would like to review it, let me know and I'll get a promo code to you.</p>
<p>We've worked hard on this over the last few months and it's a pleasure to finally have it arriving in the App Store. Thanks once again, everyone!
</p></description>
		</item>

	</channel>
</rss>

