<?xml version="1.0" encoding="UTF-8"?><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"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Collisions and Collectables: How To Make a Tile-Based Game with Cocos2D Part 2</title>
	<atom:link href="http://www.raywenderlich.com/1186/collisions-and-collectables-how-to-make-a-tile-based-game-with-cocos2d-part-2/feed" rel="self" type="application/rss+xml" />
	<link>http://www.raywenderlich.com/1186/collisions-and-collectables-how-to-make-a-tile-based-game-with-cocos2d-part-2</link>
	<description>Tutorials for iPhone / iOS Developers and Gamers</description>
	<lastBuildDate>Sun, 29 Jan 2012 06:07:20 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.2</generator>
	<item>
		<title>By: Mike Croswell</title>
		<link>http://www.raywenderlich.com/1186/collisions-and-collectables-how-to-make-a-tile-based-game-with-cocos2d-part-2#comment-7819</link>
		<dc:creator>Mike Croswell</dc:creator>
		<pubDate>Wed, 15 Dec 2010 21:38:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.raywenderlich.com/?p=1186#comment-7819</guid>
		<description>Antony,  This is not the appropriate thread or place for box physics questions.  Still, your problem is that you need to look at the draw event and draw both the physics item and whatever else you associated with it.  See the box2d example in cocos2d source. -Mike</description>
		<content:encoded><![CDATA[<p>Antony,  This is not the appropriate thread or place for box physics questions.  Still, your problem is that you need to look at the draw event and draw both the physics item and whatever else you associated with it.  See the box2d example in cocos2d source. -Mike</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: antony</title>
		<link>http://www.raywenderlich.com/1186/collisions-and-collectables-how-to-make-a-tile-based-game-with-cocos2d-part-2#comment-7781</link>
		<dc:creator>antony</dc:creator>
		<pubDate>Wed, 15 Dec 2010 05:38:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.raywenderlich.com/?p=1186#comment-7781</guid>
		<description>Hi Ray,
I have a problem.
I am creating a line using CCRenderTexture in touches moved (which is shown in
the following code), and created a body.
when another body hits this body, the line is not moving but actually the
body(the body of the line) is moving.
what i want is the line should move along with this body.I am making a game
similar to inkBall game
Can you help



- (void)ccTouchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
{

	UITouch *touch = [touches anyObject];
	CGPoint start = [touch locationInView: [touch view]];
	start = [[CCDirector sharedDirector] convertToGL: start];
	CGPoint end = [touch previousLocationInView:[touch view]];
	end = [[CCDirector sharedDirector] convertToGL:end];

	// begin drawing to the render texture
	[target begin]; // CCRenderTexture (declared in .h)
	b2BodyDef drawingBodyDef;

	drawingBodyDef.userData = brush;//CCSprite

	// Call the body factory which allocates memory for the ground body
	// from a pool and creates the ground box shape (also from a pool).
	// The body is also added to the world.

	drawingBody = _world-&gt;CreateBody(&amp;drawingBodyDef);//b2Body
	b2FixtureDef drawingboxShapeDef;
	b2PolygonShape drawingBox;

	float distance = ccpDistance(start, end);
	if (distance &gt; 1)
	{
		fallingFlag=TRUE;
		int d = (int)distance;
		for (int i = 0; i CreateFixture(&amp;drawingboxShapeDef);
		}
	}
			[target end];
}</description>
		<content:encoded><![CDATA[<p>Hi Ray,<br />
I have a problem.<br />
I am creating a line using CCRenderTexture in touches moved (which is shown in<br />
the following code), and created a body.<br />
when another body hits this body, the line is not moving but actually the<br />
body(the body of the line) is moving.<br />
what i want is the line should move along with this body.I am making a game<br />
similar to inkBall game<br />
Can you help</p>
<p>- (void)ccTouchesMoved:(NSSet *)touches withEvent:(UIEvent *)event<br />
{</p>
<p>	UITouch *touch = [touches anyObject];<br />
	CGPoint start = [touch locationInView: [touch view]];<br />
	start = [[CCDirector sharedDirector] convertToGL: start];<br />
	CGPoint end = [touch previousLocationInView:[touch view]];<br />
	end = [[CCDirector sharedDirector] convertToGL:end];</p>
<p>	// begin drawing to the render texture<br />
	[target begin]; // CCRenderTexture (declared in .h)<br />
	b2BodyDef drawingBodyDef;</p>
<p>	drawingBodyDef.userData = brush;//CCSprite</p>
<p>	// Call the body factory which allocates memory for the ground body<br />
	// from a pool and creates the ground box shape (also from a pool).<br />
	// The body is also added to the world.</p>
<p>	drawingBody = _world-&gt;CreateBody(&amp;drawingBodyDef);//b2Body<br />
	b2FixtureDef drawingboxShapeDef;<br />
	b2PolygonShape drawingBox;</p>
<p>	float distance = ccpDistance(start, end);<br />
	if (distance &gt; 1)<br />
	{<br />
		fallingFlag=TRUE;<br />
		int d = (int)distance;<br />
		for (int i = 0; i CreateFixture(&amp;drawingboxShapeDef);<br />
		}<br />
	}<br />
			[target end];<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ray Wenderlich</title>
		<link>http://www.raywenderlich.com/1186/collisions-and-collectables-how-to-make-a-tile-based-game-with-cocos2d-part-2#comment-7656</link>
		<dc:creator>Ray Wenderlich</dc:creator>
		<pubDate>Tue, 14 Dec 2010 01:39:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.raywenderlich.com/?p=1186#comment-7656</guid>
		<description>@Antoni: Thanks for posting the assistance for others!

@Stornu2: Lol thanks for the kind words!  

@R. Mantero: Nice catch, tutorial updated with the fix!

@Stephen: You can move the entire tilemap just by setting its position.  To understand how this works, I recommend re-reading the section on moving the tilemap in the first part of the tutorial:

http://www.raywenderlich.com/1163/how-to-make-a-tile-based-game-with-cocos2d

Also the idea is discussed again here as well:

http://www.raywenderlich.com/2343/how-to-drag-and-drop-sprites-with-cocos2d

Hope this helps!</description>
		<content:encoded><![CDATA[<p>@Antoni: Thanks for posting the assistance for others!</p>
<p>@Stornu2: Lol thanks for the kind words!  </p>
<p>@R. Mantero: Nice catch, tutorial updated with the fix!</p>
<p>@Stephen: You can move the entire tilemap just by setting its position.  To understand how this works, I recommend re-reading the section on moving the tilemap in the first part of the tutorial:</p>
<p><a href="http://www.raywenderlich.com/1163/how-to-make-a-tile-based-game-with-cocos2d" rel="nofollow">http://www.raywenderlich.com/1163/how-to-make-a-tile-based-game-with-cocos2d</a></p>
<p>Also the idea is discussed again here as well:</p>
<p><a href="http://www.raywenderlich.com/2343/how-to-drag-and-drop-sprites-with-cocos2d" rel="nofollow">http://www.raywenderlich.com/2343/how-to-drag-and-drop-sprites-with-cocos2d</a></p>
<p>Hope this helps!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stephen Maddox</title>
		<link>http://www.raywenderlich.com/1186/collisions-and-collectables-how-to-make-a-tile-based-game-with-cocos2d-part-2#comment-7560</link>
		<dc:creator>Stephen Maddox</dc:creator>
		<pubDate>Mon, 13 Dec 2010 00:13:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.raywenderlich.com/?p=1186#comment-7560</guid>
		<description>Using your tutorial on animation, I made a character that I animate to his new position on the tilemap by using MoveTo in cocos2d.  I have been trying to figure out how instead of moving player and then updating background, if I could instead leave player in center of screen and do a MoveTo type thing on the tilemap and it move behind player creating a smooth scroll.  It is not working perhaps because I don&#039;t understand setViewpointCenter exactly or I don&#039;t know how tilemap is moved around.  Any help?</description>
		<content:encoded><![CDATA[<p>Using your tutorial on animation, I made a character that I animate to his new position on the tilemap by using MoveTo in cocos2d.  I have been trying to figure out how instead of moving player and then updating background, if I could instead leave player in center of screen and do a MoveTo type thing on the tilemap and it move behind player creating a smooth scroll.  It is not working perhaps because I don&#8217;t understand setViewpointCenter exactly or I don&#8217;t know how tilemap is moved around.  Any help?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: R.Mantero</title>
		<link>http://www.raywenderlich.com/1186/collisions-and-collectables-how-to-make-a-tile-based-game-with-cocos2d-part-2#comment-7427</link>
		<dc:creator>R.Mantero</dc:creator>
		<pubDate>Fri, 10 Dec 2010 17:59:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.raywenderlich.com/?p=1186#comment-7427</guid>
		<description>Thanks for your work. Nice tutorial!.

I think there is a little typo in the section called &quot;Gratuituous Sound Effects and Music&quot; IMHO. Where it says &quot;Simply make the following changes to HelloWorldScene.h:&quot; should be &quot;HelloWorldScene.m&quot;</description>
		<content:encoded><![CDATA[<p>Thanks for your work. Nice tutorial!.</p>
<p>I think there is a little typo in the section called &#8220;Gratuituous Sound Effects and Music&#8221; IMHO. Where it says &#8220;Simply make the following changes to HelloWorldScene.h:&#8221; should be &#8220;HelloWorldScene.m&#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stornu2</title>
		<link>http://www.raywenderlich.com/1186/collisions-and-collectables-how-to-make-a-tile-based-game-with-cocos2d-part-2#comment-7403</link>
		<dc:creator>Stornu2</dc:creator>
		<pubDate>Fri, 10 Dec 2010 09:51:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.raywenderlich.com/?p=1186#comment-7403</guid>
		<description>Ray thank you very much for the tutorials, you&#039;re the best!

You made me enter The Matrix, I feel like Neo!

Sorry for the stupid question the other day and thanks for the reply, I almost went crazy looking at google an answer for the &quot;_&quot; in front of the variables, I thought it was a way to declare a string or an array or something.

Good luck with the book.

Greetings</description>
		<content:encoded><![CDATA[<p>Ray thank you very much for the tutorials, you&#8217;re the best!</p>
<p>You made me enter The Matrix, I feel like Neo!</p>
<p>Sorry for the stupid question the other day and thanks for the reply, I almost went crazy looking at google an answer for the &#8220;_&#8221; in front of the variables, I thought it was a way to declare a string or an array or something.</p>
<p>Good luck with the book.</p>
<p>Greetings</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Antoni Massó Mola</title>
		<link>http://www.raywenderlich.com/1186/collisions-and-collectables-how-to-make-a-tile-based-game-with-cocos2d-part-2#comment-7186</link>
		<dc:creator>Antoni Massó Mola</dc:creator>
		<pubDate>Sun, 05 Dec 2010 18:05:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.raywenderlich.com/?p=1186#comment-7186</guid>
		<description>If you&#039;re using cocos2d 0.99.5 or above replace CCLabel with CCLabelTTF.</description>
		<content:encoded><![CDATA[<p>If you&#8217;re using cocos2d 0.99.5 or above replace CCLabel with CCLabelTTF.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

