<?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: Rotating Turrets: How To Make A Simple iPhone Game with Cocos2D Part 2</title>
	<atom:link href="http://www.raywenderlich.com/692/rotating-turrets/feed" rel="self" type="application/rss+xml" />
	<link>http://www.raywenderlich.com/692/rotating-turrets</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: Atif</title>
		<link>http://www.raywenderlich.com/692/rotating-turrets#comment-7725</link>
		<dc:creator>Atif</dc:creator>
		<pubDate>Tue, 14 Dec 2010 13:59:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.raywenderlich.com/?p=692#comment-7725</guid>
		<description>awesome tutorial series. Like this very much</description>
		<content:encoded><![CDATA[<p>awesome tutorial series. Like this very much</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Omer Faru Kurt</title>
		<link>http://www.raywenderlich.com/692/rotating-turrets#comment-7713</link>
		<dc:creator>Omer Faru Kurt</dc:creator>
		<pubDate>Tue, 14 Dec 2010 11:51:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.raywenderlich.com/?p=692#comment-7713</guid>
		<description>Hi everyone;

here is the code that i stuck with i couldnt figure out what is wrong. i have a function and i pass it a fixture pointer reference to add sprite on to that fixture&#039;s body. but when i run it the body shape on the screen stays as 45 degree of angle but the sprite stands like no rotation effected it.

-(void)boards_setSpriteSheetswithFixture:(b2Fixture*&amp;)fixture size:(int)size
{
    CCSprite *board = [CCSprite spriteWithFile:[NSString stringWithFormat:@&quot;board%i.jpg&quot;, size]];
    
    fixture-&gt;GetBody()-&gt;SetUserData(board);
    
    
    b2Vec2 pos = fixture-&gt;GetBody()-&gt;GetPosition();
    board.position = CGPointMake(pos.x*PTM_RATIO, pos.y*PTM_RATIO);
    
    board.rotation = -1 * CC_RADIANS_TO_DEGREES(fixture-&gt;GetBody()-&gt;GetAngle());
    
    [self addChild:board];
}

if anyone knows how to solve this please help me.. i spent hours fir this little thing..

Thank you.</description>
		<content:encoded><![CDATA[<p>Hi everyone;</p>
<p>here is the code that i stuck with i couldnt figure out what is wrong. i have a function and i pass it a fixture pointer reference to add sprite on to that fixture&#8217;s body. but when i run it the body shape on the screen stays as 45 degree of angle but the sprite stands like no rotation effected it.</p>
<p>-(void)boards_setSpriteSheetswithFixture:(b2Fixture*&amp;)fixture size:(int)size<br />
{<br />
    CCSprite *board = [CCSprite spriteWithFile:[NSString stringWithFormat:@"board%i.jpg", size]];<br />
   <br />
    fixture-&gt;GetBody()-&gt;SetUserData(board);<br />
   <br />
   <br />
    b2Vec2 pos = fixture-&gt;GetBody()-&gt;GetPosition();<br />
    board.position = CGPointMake(pos.x*PTM_RATIO, pos.y*PTM_RATIO);<br />
   <br />
    board.rotation = -1 * CC_RADIANS_TO_DEGREES(fixture-&gt;GetBody()-&gt;GetAngle());<br />
   <br />
    [self addChild:board];<br />
}</p>
<p>if anyone knows how to solve this please help me.. i spent hours fir this little thing..</p>
<p>Thank you.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ray Wenderlich</title>
		<link>http://www.raywenderlich.com/692/rotating-turrets#comment-7662</link>
		<dc:creator>Ray Wenderlich</dc:creator>
		<pubDate>Tue, 14 Dec 2010 01:47:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.raywenderlich.com/?p=692#comment-7662</guid>
		<description>@uday: Make sure your images are saved as PNGs with transparent regions for the backgrounds (not white).

@Omer: As long as you have your update loop setting the sprite&#039;s position and angle to the same position/angle as the Box2D body, it should be OK.</description>
		<content:encoded><![CDATA[<p>@uday: Make sure your images are saved as PNGs with transparent regions for the backgrounds (not white).</p>
<p>@Omer: As long as you have your update loop setting the sprite&#8217;s position and angle to the same position/angle as the Box2D body, it should be OK.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Omer Faruk Kurt</title>
		<link>http://www.raywenderlich.com/692/rotating-turrets#comment-7658</link>
		<dc:creator>Omer Faruk Kurt</dc:creator>
		<pubDate>Tue, 14 Dec 2010 01:41:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.raywenderlich.com/?p=692#comment-7658</guid>
		<description>Hi Ray,

I was wondering how to initialize a sprite already rotated by an angle. I mean I use box2d and I have a box body and I set angle to that body. Later I wanted to add a sprite to it but I couldnt arrange angle for sprite.

If someone can help me out, I ll be glad.

Thak you

Omer Faruk</description>
		<content:encoded><![CDATA[<p>Hi Ray,</p>
<p>I was wondering how to initialize a sprite already rotated by an angle. I mean I use box2d and I have a box body and I set angle to that body. Later I wanted to add a sprite to it but I couldnt arrange angle for sprite.</p>
<p>If someone can help me out, I ll be glad.</p>
<p>Thak you</p>
<p>Omer Faruk</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: udaykanth</title>
		<link>http://www.raywenderlich.com/692/rotating-turrets#comment-7463</link>
		<dc:creator>udaykanth</dc:creator>
		<pubDate>Sat, 11 Dec 2010 09:05:51 +0000</pubDate>
		<guid isPermaLink="false">http://www.raywenderlich.com/?p=692#comment-7463</guid>
		<description>Hi Ray,
The images are rectangles and we move them on white background its ok.If we use the same images with different background color than rectangles can be seen as background color is no longer white.How can we get rid of this problem what should i do to make only object to appear on any background.

I am a beginner and your help is appreciated.</description>
		<content:encoded><![CDATA[<p>Hi Ray,<br />
The images are rectangles and we move them on white background its ok.If we use the same images with different background color than rectangles can be seen as background color is no longer white.How can we get rid of this problem what should i do to make only object to appear on any background.</p>
<p>I am a beginner and your help is appreciated.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ray Wenderlich</title>
		<link>http://www.raywenderlich.com/692/rotating-turrets#comment-7104</link>
		<dc:creator>Ray Wenderlich</dc:creator>
		<pubDate>Sat, 04 Dec 2010 00:14:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.raywenderlich.com/?p=692#comment-7104</guid>
		<description>@sazzad: I took a brief look at your question.  It seems like your problem is due to continuously allocating/deallocating sprites.  A common solution is to reuse a pre-allocated buffer of Sprites.  I.e. create 100 sprites at start, and keep track of which ones are currently in use and which aren&#039;t, rather than continuously allocating sprites when needed.

@Manoj: Thanks!</description>
		<content:encoded><![CDATA[<p>@sazzad: I took a brief look at your question.  It seems like your problem is due to continuously allocating/deallocating sprites.  A common solution is to reuse a pre-allocated buffer of Sprites.  I.e. create 100 sprites at start, and keep track of which ones are currently in use and which aren&#8217;t, rather than continuously allocating sprites when needed.</p>
<p>@Manoj: Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Manoj</title>
		<link>http://www.raywenderlich.com/692/rotating-turrets#comment-6852</link>
		<dc:creator>Manoj</dc:creator>
		<pubDate>Mon, 29 Nov 2010 07:35:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.raywenderlich.com/?p=692#comment-6852</guid>
		<description>thanks ray it is again a nice tutorial</description>
		<content:encoded><![CDATA[<p>thanks ray it is again a nice tutorial</p>
]]></content:encoded>
	</item>
</channel>
</rss>

