<?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: sprites - Recent Topics</title>
		<link>http://www.cocos2d-iphone.org/forum/tags/sprites</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:53 +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/sprites/topics" rel="self" type="application/rss+xml" />

		<item>
			<title>NOG on "Initializing multiple subclassed sprites of the same kind from tiled"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/17180#post-96734</link>
			<pubDate>Wed, 01 Jun 2011 17:06:37 +0000</pubDate>
			<dc:creator>NOG</dc:creator>
			<guid isPermaLink="false">96734@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I'm trying to figure out the best way to initialize multiple sprites placed in Tiled that are the same type.  I don't even know really how to start off in Tiled, because I'm only used to initializing one sprite by filling out the name field, and then in my CCLayer with the map I do something like</p>
<pre><code>CCTMXObjectGroup *objects = [theMap objectGroupNamed:@&#34;oj&#34;];
NSMutableDictionary *startPoint = [objects objectNamed:@&#34;StartPoint&#34;];
int x = [[startPoint valueForKey:@&#34;x&#34;] intValue];
int y = [[startPoint valueForKey:@&#34;y&#34;] intValue];

hero = [[HeroClass alloc] init];

[self addChild:hero.heroSpriteSheet];

hero.heroSprite.position = ccp(x,y);</code></pre>
<p>As you can see, my "hero" is subclassed, and this goes for another sprite that is a bird, but I want an x amount of them.  I import the header of HeroClass and create a pointer, make a property and synthesize that in my main file and finally release HeroClass in dealloc.  I have a feeling that I will most likely end up use NSMutableArray, but I don't really know how in the case of subclassing. Also I'm not sure if I'll be using objectNamed:@"name" because I'll have x number of these sprites that I will be just duplicating throughout Tiled. </p>
<p>There's a helpful post here that shows how to add multiple sprites, but I don't know how to relate it to Tiled or subclassing:<br />
<a href="http://www.iphonedevsdk.com/forum/iphone-sdk-game-development/58334-adding-sprites-screen-when-detecting-tap-cocos2d.html" rel="nofollow">http://www.iphonedevsdk.com/forum/iphone-sdk-game-development/58334-adding-sprites-screen-when-detecting-tap-cocos2d.html</a></p>
<p>Does anyone have any useful pointers or code examples relating how to resolve my issue? Thanks!
</p></description>
		</item>
		<item>
			<title>Par on "Additive Coloring Solution? Thoughts?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/20487#post-113919</link>
			<pubDate>Thu, 01 Sep 2011 20:24:13 +0000</pubDate>
			<dc:creator>Par</dc:creator>
			<guid isPermaLink="false">113919@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Alright so I'm trying to find a solution to adding colors onto a sprite that are not in the sprite by default... the equivalent of tinting in Flash. </p>
<p>Now I can do this relatively easy with photoshop and creating two files but I'd like to be able to do it programmatically.  I think I have a solution; however, I don't know if step two is possible or how to accomplish it. Take a look at this and give me some feedback on it as a solution. </p>
<p><img src="http://digitallybold.com/wp-content/uploads/2011/09/additivecoloring.jpg" alt="" />
</p></description>
		</item>
		<item>
			<title>mruffa on "Disappearing graphics (CCSprite) on NOT debug"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28710#post-141509</link>
			<pubDate>Fri, 27 Jan 2012 10:55:25 +0000</pubDate>
			<dc:creator>mruffa</dc:creator>
			<guid isPermaLink="false">141509@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hey gyus,</p>
<p>I'm developing games on cocos2d for a while, but in the newest game I got something strange. </p>
<p>On debug everything works fine, otherwise some of graphics - CCSprite  - are disappearing.</p>
<p>Anybody been there? :)</p>
<p>thanks!
</p></description>
		</item>
		<item>
			<title>goodeats2009 on "removing sprite in array help?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/22192#post-123225</link>
			<pubDate>Thu, 27 Oct 2011 08:06:56 +0000</pubDate>
			<dc:creator>goodeats2009</dc:creator>
			<guid isPermaLink="false">123225@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>hi,  so i have an NSMutableArray that creates sprites, portion of code below<br />
<pre><code>if ([_pathFinder isCollision:moveRadius]==YES)
            {
                for (int i=0; i&#60;[enemySprites count]; i++)
                {
                    CCSprite *targetIcon = [CCSprite  spriteWithFile:@&#34;target.png&#34;];
                    EnemySprite *enemy = [enemySprites objectAtIndex:i];
                    enemyPosition = nodeCoord_To_tileCoord(_bgMap, enemy.position);
                    if ((enemyPosition.x == moveRadius.x) &#38;&#38; (enemyPosition.y == moveRadius.y))
                    {
                        [targetIconArray addObject:targetIcon];
                        targetIcon.position = enemy.position;
                        [_bgMap addChild:targetIcon z:10];
                    }
                    else if ((enemyPosition.x == tileTouchedPoint.x) &#38;&#38; (enemyPosition.y == tileTouchedPoint.y))
                    {
                        CCLOG(@&#34;killed enemy %i at: %g,%g&#34;,i,enemyPosition.x,enemyPosition.y);
                        [_bgMap removeChild:enemy cleanup:YES];
                        [enemySprites removeObjectAtIndex:i];
                        [_bgMap removeChild:targetIcon cleanup:YES];
                        [targetIconArray removeObjectAtIndex:i];
                        CCLOG(@&#34;enemy new count=%i %i&#34;,[enemySprites count], [targetIconArray count]);
                        touchCount=0;
                        [self hidePlayerMoveRadius];
                    }
                }
            }</code></pre>
<p>I also have a method that removes the sprites after i click on them (e.g. attack/killed the sprite)<br />
<pre><code>-(void) hidePlayerMoveRadius
{
    for (CCSprite *targetIcon in targetIconArray)
    {
        [_bgMap removeChild:targetIcon cleanup:YES];
    }
    [targetIconArray removeAllObjects];
}</code></pre>
<p>the problem is after i click on the sprite and remove it from the array, the sprites don't disappear and still remain in the screen.  i am thinking since i deleted a sprite from the array and the index of the rest of the sprites changed  that when i call the "hidePlayerMoveRadius" method it does not work anymore because the index got all messed up?  if i don't delete the sprite from the array and invoke the  "hidePlayerMoveRadius", then it works fine (as in i can toggle the sprites to be created and removed).</p>
<p>any help is appreciated. thanks
</p></description>
		</item>
		<item>
			<title>elsevero on "removing sprites in order"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28681#post-141328</link>
			<pubDate>Thu, 26 Jan 2012 09:01:22 +0000</pubDate>
			<dc:creator>elsevero</dc:creator>
			<guid isPermaLink="false">141328@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hello guys,</p>
<p>I've been searching for a solution for my finding objects game but couldn't find anything yet; What I must deal is that I have couple of objects that are placed on top of each other and I need to remove them in a certain order (in this case it will be the z order).<br />
How do I manage the objects that are placed in two layers which have been added to a parallaxNode? </p>
<p>any examples or tips for this will be nice!
</p></description>
		</item>
		<item>
			<title>polatolu on "Sprite Master"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28564#post-140672</link>
			<pubDate>Sun, 22 Jan 2012 16:42:57 +0000</pubDate>
			<dc:creator>polatolu</dc:creator>
			<guid isPermaLink="false">140672@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hi Guys,</p>
<p>I want to talk about Sprite Master. Sprite Master is a sprite sheet generator for Mac. It generates sprite sheets using Basic and MaxRects algorithms. Also, generates coordinate data, exports .plist for Cocos2D.</p>
<p>If you are interested, you can take a look at <a href="http://www.mobinodo.com/spritemaster" rel="nofollow">http://www.mobinodo.com/spritemaster</a> for more details.
</p></description>
		</item>
		<item>
			<title>jellyfish on "How do I get a sprite to leave &quot;prints&quot; of itself that fade out."</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28002#post-137567</link>
			<pubDate>Mon, 02 Jan 2012 08:25:58 +0000</pubDate>
			<dc:creator>jellyfish</dc:creator>
			<guid isPermaLink="false">137567@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>When you are loading a YouTube video, there is a little dot, moving in a circle, that has four dots, following it, each progressively darker, almost like footprints that fade out.  I want to find different ways of doing this, to find the one that best suits my purpose.  I do not want a single rotating image, with the dots already drawn on it, because I want the option of moving the dot in different ways and directions (e.g.  following a path).  I have experimented with particles and gotten lots of flashy effects, but could not reduce it to just four "prints" that fade out.<br />
Here is the dot going in a circle:</p>
<p>		`CCSprite *myBox = [CCSprite node];<br />
        [myBox setTextureRect:CGRectMake(0, 20, 8, 8)];<br />
        [myBox setPosition:ccp(160, 340)];<br />
        [myBox setAnchorPoint:ccp(.5,10)];</p>
<p>        [myBox setColor:ccGREEN];<br />
        [self addChild:myBox];</p>
<p>        id rotate1 = [CCRotateBy actionWithDuration:0 angle:15];<br />
        id delay = [CCDelayTime actionWithDuration:.1];</p>
<p>        [myBox runAction:[CCRepeatForever actionWithAction:[CCSequence actions:rotate1, delay, nil]]];`</p>
<p>Thanks.
</p></description>
		</item>
		<item>
			<title>Par on "[TUTORIAL/GUIDE] Additive Sprite Coloring &amp; Tinting"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28333#post-139418</link>
			<pubDate>Fri, 13 Jan 2012 19:34:14 +0000</pubDate>
			<dc:creator>Par</dc:creator>
			<guid isPermaLink="false">139418@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I just finished a tutorial on setting up new sprite classes that will use setColor to modify the sprites colors in different ways from normal. Here's the link: <a href="http://digitallybold.com/314/cocos2d-additive-sprite-color-tinting" rel="nofollow">http://digitallybold.com/314/cocos2d-additive-sprite-color-tinting</a></p>
<p>The tutorial explains how to subclass CCSprite and change the OpenGL texture rendering so that setColor produces different effects. For example: </p>
<pre><code>[sprite setColor:ccc3(0, 0, 255)];</code></pre>
<p>produces different things based on the way your texture environment is set up allowing you to have additive coloring and even tinting. As seen below:<br />
<img src="http://digitallybold.com/wp-content/uploads/2012/01/coloring1.png" /></p>
<p>Likewise you can take the tinting and apply it in lesser amounts to produce different effects like below:<br />
<img src="http://digitallybold.com/wp-content/uploads/2012/01/coloring2.png" /></p>
<p>Anyway, I know this has been asked for in the past so I wanted to share how I've been able to do it. Here's the link again: <a href="http://digitallybold.com/314/cocos2d-additive-sprite-color-tinting" rel="nofollow">http://digitallybold.com/314/cocos2d-additive-sprite-color-tinting</a></p>
<p>Thanks, I hope this helps. I'd love to see someone take the openGL and come up with some different effects.
</p></description>
		</item>
		<item>
			<title>SeruK on "Universal iOS App - iPad scaling issues"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28065#post-137995</link>
			<pubDate>Wed, 04 Jan 2012 17:49:16 +0000</pubDate>
			<dc:creator>SeruK</dc:creator>
			<guid isPermaLink="false">137995@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I am currently working on a universal app with Cocos2D and I have some questions about scaling. I have already dealt with the positioning issue thanks to this guy (<a href="http://michaelgilkes.info/cocos2d-using-hd-images-for-ipad-in-a-universal-app/" rel="nofollow">http://michaelgilkes.info/cocos2d-using-hd-images-for-ipad-in-a-universal-app/</a>), but I want to stretch the -hd textures to cover up the iPad window.</p>
<p>i.e. for my 'root' class (which inherits CCSprite) I do this after initializing:<br />
<pre><code>if(IS_IPAD())
        {
            self.scaleX = kIpadScaleXRatio;
            self.scaleY = kIpadScaleYRatio;
        }</code></pre>
<p>I already know the bounding box method fails to take scaling into account so I overrode it:<br />
<pre><code>- (CGRect)boundingBox
{
    CGRect rect = CGRectMake(self.position.x, self.position.y, self.contentSize.width*self.scaleX, self.contentSize.height*self.scaleY);

    CGRect returnRect = CGRectApplyAffineTransform(rect, [self nodeToParentTransform]);

    return CC_RECT_PIXELS_TO_POINTS(returnRect);
}</code></pre>
<p>None of this seems to work perfectly, since my 640x960 texture doesn't actually cover up the entire window. I really want to avoid a third set of textures for the iPad version.</p>
<p>Would this approach even work? Or am I making a total arse of myself? If it actually would work, is there anything else to consider but the boundingBox method?</p>
<p>Thanks in advance.
</p></description>
		</item>
		<item>
			<title>tetna on "Simple Collision Detection for Newbie"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28053#post-137909</link>
			<pubDate>Wed, 04 Jan 2012 07:41:57 +0000</pubDate>
			<dc:creator>tetna</dc:creator>
			<guid isPermaLink="false">137909@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>im really new to cocos2d and i downloaded this open source app.</p>
<p>what im trying to do is to put enemies on the app and hopefully add some other functions</p>
<p>i have successfully added the enemies however im stucked at this collision detection. as i said im new to cocos2d and i really dont know anything about</p>
<p>box2d and chipmunk.. i dont have knowledge in java or in c++</p>
<p>maybe there's some other way to detect collision??</p>
<p>here a sample of my code:<br />
Code:<br />
<pre><code>- (id)init {
//	NSLog(@&#34;Game::init&#34;);

	if(![super init]) return nil;

	gameSuspended = YES;

	AtlasSpriteManager *spriteManager = (AtlasSpriteManager*)[self getChildByTag:kSpriteManager];

	[self initPlatforms];

	AtlasSprite *bird = [AtlasSprite spriteWithRect:CGRectMake(608,16,44,32) spriteManager:spriteManager];
	[spriteManager addChild:bird z:4 tag:kBird];

	AtlasSprite *bonus;

	for(int i=0; i&#60;kNumBonuses; i++) {
		bonus = [AtlasSprite spriteWithRect:CGRectMake(608+i*32,256,25,25) spriteManager:spriteManager];
		[spriteManager addChild:bonus z:4 tag:kBonusStartTag+i];
		bonus.visible = NO;
	}

//	LabelAtlas *scoreLabel = [LabelAtlas labelAtlasWithString:@&#34;0&#34; charMapFile:@&#34;charmap.png&#34; itemWidth:24 itemHeight:32 startCharMap:&#039; &#039;];
//	[self addChild:scoreLabel z:5 tag:kScoreLabel];

	BitmapFontAtlas *scoreLabel = [BitmapFontAtlas bitmapFontAtlasWithString:@&#34;0&#34; fntFile:@&#34;bitmapFont.fnt&#34;];
	[self addChild:scoreLabel z:5 tag:kScoreLabel];
	scoreLabel.position = ccp(160,430);

	[self schedule:@selector(step:)];

	isTouchEnabled = YES;
	isAccelerometerEnabled = YES;

	[[UIAccelerometer sharedAccelerometer] setUpdateInterval:(1.0 / kFPS)];

	[self startGame];
	[self schedule:@selector(gameLogic:) interval:5.0];
	return self;

}

-(void)addTarget {

	Sprite *target = [Sprite spriteWithFile:@&#34;waa.gif&#34;];
	target.position = ccp(300,400);

	[self addChild:target];

	CGSize winSize = [[Director sharedDirector]winSize];
	int minX = target.contentSize.height/2;
	int maxX = winSize.height -target.contentSize.height/2;
	int rangeX = maxX - minX;
	int actualX = (arc4random() % rangeX) +minX;

	int minDuration = 2.0;
	int maxDuration = 4.0;
	int rangeDuration = maxDuration - minDuration;
	int actualDuration = (arc4random() % rangeDuration) + minDuration;

	id actionMove = [MoveTo actionWithDuration:actualDuration position:ccp(-target.contentSize.width/2,actualX)];
	id actionMoveDone = [CallFuncN actionWithTarget:self selector:@selector(spriteMoveFinished:)];
	[target runAction:[Sequence actions:actionMove, actionMoveDone,nil]];

}

-(void)spriteMoveFinished:(id)sender {
	Sprite *sprite = (Sprite *)sender;
	[self removeChild:sprite cleanup:YES];
}
-(void)gameLogic:(ccTime)dt {
	[self addTarget];

}</code></pre>
<p>PS: i have read other topics about this but i dont really understand a thing</p>
<p>i hope someone could help i really need it.. thanks
</p></description>
		</item>
		<item>
			<title>Heartbound on "Would anyone kind enough quickly explain why this is possible.."</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/27861#post-136826</link>
			<pubDate>Sun, 25 Dec 2011 06:43:15 +0000</pubDate>
			<dc:creator>Heartbound</dc:creator>
			<guid isPermaLink="false">136826@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>It would answer a big question of mine and get me started. </p>
<p>I just recently started learning cocos2d, I spent about 10 months learning Objective C, and just jumped into cocos2D a few days ago. I'm reading a great book and I wrote some code.. but this particular thing bugs me about my code. </p>
<p>For example, I have a sprite on screen that moves to a position where I click and when it reaches that position, it proceeds on its way to the end of the screen.. when it reaches the end, it just re-appears on the other side again. It's very simple new, beginner stuff. </p>
<p>Here is what I DON'T get.. </p>
<p>I created my sprite using </p>
<p>CCSprite *myImage;</p>
<p>Then in a method, I did this </p>
<p>myImage = [CCSprite spriteWithFile:@"fileName.png"];<br />
myImage.position = ccp(150,150);<br />
[self addChild:myImage];</p>
<p>and there is obviously more code I wrote but that is irrelevant, What bothers me is this..<br />
When I change the declaration part of my code from 'CCSprite *myImage;' to , let's say... 'CCTMXLayer *myImage; </p>
<p>It all compiles the same and works fine. </p>
<p>Maybe my confusion is now obvious but I'll ask anyway.. why DOES it work.. why can I create sprites using CCTMXlayer , actually I can create the sprite using any other class as well.. Almost any other class that sprung off from CCNode.. </p>
<p>What's the point in using CCSprite and if it all works the same, what's the purpose. </p>
<p>Thank's. I hope it all makes sense. I know there's some information that might be unnecessary but I just wanted it all to be clear. Thanks.
</p></description>
		</item>
		<item>
			<title>callispo on "2 sprites sheets of 1024 * 1024 giving memory spike. Any advice?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/27825#post-136701</link>
			<pubDate>Fri, 23 Dec 2011 14:00:17 +0000</pubDate>
			<dc:creator>callispo</dc:creator>
			<guid isPermaLink="false">136701@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>My game is receiving memory warnings. Instruments shows a spike of around 21MB. This is happening only when I load two extra sprite sheets, each of them is 1024 * 1024</p>
<p>I am using [CCSprite spriteWithFile:] to load sprites. </p>
<p>I believe there are many games out there which load a lot of sprites and just two sprite sheets of 1024*1024 shouldnt give me memory warnings. What am I doing wrong here? Or is it that theres some secret sauce that everyone, except me, knows? :S</p>
<p>Any suggestions regarding optimizations are highly appreciated :)
</p></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>tiggybouncer on "App keeps on crashing"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/20392#post-113392</link>
			<pubDate>Tue, 30 Aug 2011 07:28:03 +0000</pubDate>
			<dc:creator>tiggybouncer</dc:creator>
			<guid isPermaLink="false">113392@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>My app is a game, where you have to match up 3 coloured stones in a row.<br />
When its first loaded up, load up multiple files. One is called 'background.png', which is loaded first, then the Spritesheet is loaded ('colouredSheet.png'). Then, when it calls the font,  so it can be added, it crashes the app. Code is below:<br />
<pre><code>/**/ /*Error causing crash here*/		CCLabelBMFont * scoreLabel = [CCLabelBMFont labelWithString:@&#34;0&#34; fntFile:@&#34;newScore.fnt&#34;];
			[scoreLabel setColor:ccBLACK];
			[self addChild:scoreLabel z:2 tag:kScoreLabel];
			[scoreLabel setPosition:ccp(115,275)];
			[scoreLabel setAnchorPoint:ccp(1,0.5)];
			[scoreLabel setScale:1];</code></pre>
<p>It has been tested in the Simulator on the iPhone 4; and on a iPod Touch 2nd Gen. On the simulator, it rotates the screen, the quits. On the iPod, it loads up the image 'powered by Cocos2D' then crashes.<br />
If you need more code, please PM me.<br />
Thanks.
</p></description>
		</item>
		<item>
			<title>dgtheman on "Question about sprites on top of each other (specifically AIS)"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/24874#post-131004</link>
			<pubDate>Sun, 04 Dec 2011 01:46:39 +0000</pubDate>
			<dc:creator>dgtheman</dc:creator>
			<guid isPermaLink="false">131004@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>So I have made my own AIS so far, and they function well. However, I would like to know how I could somehow make it so that they dont appear on top of each other when attacking. They are the same sprite so sometimes while attacking or while walking they will look like only one image when there are supposed to be two. Does anyone have any ideas on how to fix this?</p>
<p>Extra Info:<br />
The guards (ais) move such that they are following the character. This is the time I want to make it so that the AIS do not look like the are the same image. </p>
<p>So lets say I have the number 1 then if I put another 1 on top of 1 I get a resulting image of 1. So I want to change it so that instead of 1 it will show 1 1. I cant just change the position because they would be following the hero the whole time so changing the position makes the movement of the ais very unnatural.
</p></description>
		</item>
		<item>
			<title>jed758 on "Moving Objects/ Touch Detection"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/24829#post-130920</link>
			<pubDate>Sat, 03 Dec 2011 16:13:33 +0000</pubDate>
			<dc:creator>jed758</dc:creator>
			<guid isPermaLink="false">130920@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>In my iphone app i need to be able to detect tiuches to drag around different sprites/b2bodys (im not sure which one to use for collision detection), at the moment when i drag them around they all stack on top of each other and im not sure how to detect individual sprites/b2bodys , any help is appreciated, thanks :D
</p></description>
		</item>
		<item>
			<title>pikali on "Applying texture sprite for a Ragdoll object"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/24679#post-130082</link>
			<pubDate>Tue, 29 Nov 2011 07:02:30 +0000</pubDate>
			<dc:creator>pikali</dc:creator>
			<guid isPermaLink="false">130082@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hey,</p>
<p>I am trying to achieve a realistic death sequence for a character in my game by replacing ragdoll object once it gets hit (ie) dies. I was wondering how to add textures for the ragdoll which comprise of limbs and other joints. </p>
<p>Many Thanks !
</p></description>
		</item>
		<item>
			<title>jed758 on "Detecting Touches"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/23892#post-128974</link>
			<pubDate>Sun, 27 Nov 2011 09:57:52 +0000</pubDate>
			<dc:creator>jed758</dc:creator>
			<guid isPermaLink="false">128974@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>In my iphone app i need to be able to detect tiuches to drag around different sprites/b2bodys (im not sure which one to use for collision detection),  at the moment when i drag them around they all stack on top of each other and im not sure how to detect individual sprites/b2bodys , any help is appreciated, thanks :D
</p></description>
		</item>
		<item>
			<title>MaKo34 on "cocos2d drag sprites avoid overlapping"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/23741#post-128339</link>
			<pubDate>Wed, 23 Nov 2011 12:20:41 +0000</pubDate>
			<dc:creator>MaKo34</dc:creator>
			<guid isPermaLink="false">128339@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>im moving some sprites around with touches in my app,</p>
<p>but when a sprite gets to close to another, they snap one on top of the other...</p>
<p>so, how can i avoid this?</p>
<p>like having the object that is not touched static</p>
<p>thanks!
</p></description>
		</item>
		<item>
			<title>vol_ya on "How to broke CCSprite"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/23786#post-128562</link>
			<pubDate>Thu, 24 Nov 2011 16:04:31 +0000</pubDate>
			<dc:creator>vol_ya</dc:creator>
			<guid isPermaLink="false">128562@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hi all,<br />
I have some situation. I should to break some object (or objects) (CCSprite with box2d body) to many small parts if object is broke and need display some damage and cracks for object.<br />
Many small parts should fall to down by gravity. It should looks to break object in Angry Birds.<br />
Could you please help me with this issue.
</p></description>
		</item>
		<item>
			<title>Duckwit on "[?] Advice on Constructing Customizable Characters"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/23781#post-128537</link>
			<pubDate>Thu, 24 Nov 2011 13:03:24 +0000</pubDate>
			<dc:creator>Duckwit</dc:creator>
			<guid isPermaLink="false">128537@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>So lately I've been quite held back with my development of code-name project 'Office Guy' - it's no 6 week project.<br />
So far I have just been developing the the basic (graphics and basic programming) of the psuedo-3D gameplay. </p>
<p>I have begun work on the sheduled melee and projectile weapons and combat system but have been faced with a dilemna that, before locking into a particular prodecure, I would like some advice from people - ideally from those with experience in this (or a similar) area. </p>
<p>If you need to know any more details/specifications as to what I am trying to achieve before reasoning a conclusion, please let me know. </p>
<p>Thanks :)</p>
<p>EDIT: Haha, notice my catchy alliteration in the topic title? :)
</p></description>
		</item>
		<item>
			<title>brackishlake on "A question about TiledMap layers"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/22885#post-126584</link>
			<pubDate>Thu, 17 Nov 2011 20:36:32 +0000</pubDate>
			<dc:creator>brackishlake</dc:creator>
			<guid isPermaLink="false">126584@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I have a ground layer that was created with Tiles. In my game, you can add Sprites to the map. These sprites are fixed; they move with the map and in fact sit directly on top of the map at the exact same coordinates. (You did this by clicking on the grid where you want to place the Sprite.)</p>
<p>Currently I add these sprites using the addChild method of the tiled map.</p>
<p>I want to add a "delete" option using CCTMXLayer's removeTileAt method. But when I use it, it removes the tile from the ground layer - and my sprite is still sitting there.</p>
<p>Should I write my own method that removes a sprite at a given grid coordinate, or should I be replacing the ground-layer tile with my new sprite (since the tile itself is also just a sprite)?</p>
<p>Thanks!
</p></description>
		</item>
		<item>
			<title>rifts on "Zwoptex won&#039;t run?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/22769#post-126064</link>
			<pubDate>Mon, 14 Nov 2011 23:41:07 +0000</pubDate>
			<dc:creator>rifts</dc:creator>
			<guid isPermaLink="false">126064@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>is there some requirement to run this? When I download it directly from the website the icon looks like this and when I try to run it I get this error.</p>
<p>I'm running snow leopard 10.6.7</p>
<p><a href="http://i.imgur.com/Jo6Ya.png" rel="nofollow">http://i.imgur.com/Jo6Ya.png</a></p>
<p>thanks
</p></description>
		</item>
		<item>
			<title>brackishlake on "Best way to schedule an animation"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/22713#post-125839</link>
			<pubDate>Sun, 13 Nov 2011 19:36:38 +0000</pubDate>
			<dc:creator>brackishlake</dc:creator>
			<guid isPermaLink="false">125839@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Day two of learning Objective C and Cocos2D...</p>
<p>In my game, users can add buildings to the game world. I do this by having a <code>GameObject</code> which is a subclass of <code>NSObject</code>. I use <code>initWithParent:(CCNode *)parent</code> to <code>addChild</code> the sprite back to my GameWorld scene. Works great!</p>
<p>My question is about scheduling. Until my GameObject gets an attribute of <code>(BOOL) isBuilt</code>, I use a different sprite image to make it seem like the building is under construction. After so many ticks, I'm going to set <code>isBuilt TRUE</code> and change the sprite image permanently.</p>
<p>What's the best way to do this? I add the sprites I create to an Array - but that actually doesn't carry with it my <code>isBuilt</code> property, because that belongs to the GameObject, not the sprite itself. Should I add the entire object to an array? And if I do that, how do I access the sprite within that object?</p>
<p>Or should I add a scheduler operation for every single individual object, rather than one scheduling operation and cycling through my array to do things?</p>
<p>THANK YOU!
</p></description>
		</item>
		<item>
			<title>brackishlake on "Organizing game objects"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/22675#post-125735</link>
			<pubDate>Sat, 12 Nov 2011 19:22:21 +0000</pubDate>
			<dc:creator>brackishlake</dc:creator>
			<guid isPermaLink="false">125735@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>[Also posted on Forrst]<br />
Preface: This is my first game and I'm typically a PHP developer (i.e., I believe in really messy code with lots of helper functions) or a nodeJS developer (i.e., I like to show off how much I can nest callbacks).</p>
<p>Issue: In my game you can create new sprites, which all have unique attributes, most notably their sprite icon. I've created a GameObject class, which is a subclass of CCNode. It stores the common elements of all my sprites (they all cost money and all have a sprite filename, for example).</p>
<p>From there, I'd like to create subclasses of my GameObject class (so their superclass is also CCNode) for each unique object. These subclasses — say MyMonsterClass, MyGremlinClass, MyMittRomneyClass — would set the superclass's sprite filename in their init function — so each has a unique icon. The init call would also differentiate in other ways. For example, they all have unique unitCosts. Some have attributes that are not shared with other sprites.</p>
<p>I initially subclassed CCSprite, but then decided that was the wrong thing to do, since I'm not overwriting or redesigning that class in any real way. I essentially would never explicitly call a "GameObject"; rather, I would call a particular subclass, like MyMonsterClass, and it merely inherits GameObject for the purpose of setting those common variables from the superclass.</p>
<p>Is this the correct way to organize my game objects? Am I thinking about this the right way? Or should I just close Xcode and go back to making web apps?
</p></description>
		</item>
		<item>
			<title>Objective Zero on "Box2D b2ContactListener (Collision Detection)"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/22651#post-125655</link>
			<pubDate>Fri, 11 Nov 2011 23:06:51 +0000</pubDate>
			<dc:creator>Objective Zero</dc:creator>
			<guid isPermaLink="false">125655@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hey,</p>
<p>In my game, I have about 6 different variations of objects. Each object has a b2Body, b2BodyDef, and b2FixtureDef attached to it.<br />
In my case, my b2Bodys are following my CCSprites since Cocos2D is easier with animations.</p>
<p>Anyway I am trying to follow Ray Wenderlich's tutorial: <a href="http://www.raywenderlich.com/606/how-to-use-box2d-for-just-collision-detection-with-cocos2d-iphone" rel="nofollow">http://www.raywenderlich.com/606/how-to-use-box2d-for-just-collision-detection-with-cocos2d-iphone</a></p>
<p>The thing is I am quite confused on what he is actually doing!<br />
Questions:<br />
1. Do I need the same 'MyContactListener' classes that he is using, even though he has a different amount of fixtures that CAN collide?<br />
2. Does my Contact Listener code in my CCScene need to be in my game loop?<br />
3. This is his main code for his collision detection in his CCScene:</p>
<pre><code>std::vector&#60;b2Body *&#62;toDestroy;
std::vector&#60;MyContact&#62;::iterator pos;
for(pos = _contactListener-&#62;_contacts.begin();
    pos != _contactListener-&#62;_contacts.end(); ++pos) {
    MyContact contact = *pos;

    b2Body *bodyA = contact.fixtureA-&#62;GetBody();
    b2Body *bodyB = contact.fixtureB-&#62;GetBody();
    if (bodyA-&#62;GetUserData() != NULL &#38;&#38; bodyB-&#62;GetUserData() != NULL) {
        CCSprite *spriteA = (CCSprite *) bodyA-&#62;GetUserData();
        CCSprite *spriteB = (CCSprite *) bodyB-&#62;GetUserData();

        if (spriteA.tag == 1 &#38;&#38; spriteB.tag == 2) {
            toDestroy.push_back(bodyA);
        } else if (spriteA.tag == 2 &#38;&#38; spriteB.tag == 1) {
            toDestroy.push_back(bodyB);
        }
    }
}

std::vector&#60;b2Body *&#62;::iterator pos2;
for(pos2 = toDestroy.begin(); pos2 != toDestroy.end(); ++pos2) {
    b2Body *body = *pos2;
    if (body-&#62;GetUserData() != NULL) {
        CCSprite *sprite = (CCSprite *) body-&#62;GetUserData();
        [_spriteSheet removeChild:sprite cleanup:YES];
    }
    _world-&#62;DestroyBody(body);
}

if (toDestroy.size() &#62; 0) {
    [[SimpleAudioEngine sharedEngine] playEffect:@&#34;hahaha.caf&#34;];
}</code></pre>
<p>The thing is, like before he only has 2 things that CAN collide. In my case I have 6. So would I have to modify that code in any way to work with my 6 possible b2Bodys?</p>
<p>Thanks!
</p></description>
		</item>
		<item>
			<title>Cristiano on "Brush Application"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/22249#post-123530</link>
			<pubDate>Sat, 29 Oct 2011 05:50:30 +0000</pubDate>
			<dc:creator>Cristiano</dc:creator>
			<guid isPermaLink="false">123530@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Good Day! i am a student trying to learn iOS app dev on my own i have a background for Objective-C and Cocos2d programming and for my first app i want to do build a Brush/Painting/Drawing app something like that but i don't know what is the write  way... i already coded how to draw line on touch and touchmoved but i it doesn't look good, there's no brush feel on the ink.
</p></description>
		</item>
		<item>
			<title>goodeats2009 on "Help with sprites moving in a sequence"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/22061#post-122601</link>
			<pubDate>Sun, 23 Oct 2011 06:49:32 +0000</pubDate>
			<dc:creator>goodeats2009</dc:creator>
			<guid isPermaLink="false">122601@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>hi, can you please help me how i can make my sprites move one at a time.  right now they all move at the same time, i want the next sprite to move after the last sprite move has finished.  here is my method</p>
<pre><code>-(void) enemySeeksGoal
{
    CGPoint goalPosition = nodeCoord_To_tileCoord(_bgMap,ccp(496,608));

    [_pathFinder setPlayerPosition:mainPlayerPosition];

    for (EnemySprite *enemy in enemySprites)
    {
    [self updateSpritePositions];

    enemyPosition = nodeCoord_To_tileCoord(_bgMap, enemy.position);
    CCLOG(@&#34;mainPlayerPosition=%g,%g&#34;,tileTouchedPoint.x,tileTouchedPoint.y);
    CCLOG(@&#34;LastenemyPosition=%g,%g&#34;,enemyPosition.x,enemyPosition.y);

    [_pathFinder stepSprite:enemy from:enemyPosition to:goalPosition atSpeed:0.5f];
        CCLOG(@&#34;enemy move done&#34;);

    }
}</code></pre>
<p>i want to include a timerDelay like<br />
<pre><code>id delayTime= [CCDelayTime actionWithDuration:(moveCounter)];</code></pre>
<p>i tried:<br />
<pre><code>CCAction *theAction = [CCSequence actions:[_pathFinder stepSprite:enemy from:enemyPosition to:goalPosition atSpeed:0.5f], delayTime, nil];</code></pre>
<p>but it does not accept<br />
<pre><code>[_pathFinder stepSprite:enemy from:enemyPosition to:goalPosition atSpeed:0.5f];</code></pre>
<p>my syntax is wrong.</p>
<p>appreciate any help.  thanks
</p></description>
		</item>
		<item>
			<title>goodeats2009 on "how to keep track of array of  sprites?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/21879#post-121565</link>
			<pubDate>Mon, 17 Oct 2011 01:59:07 +0000</pubDate>
			<dc:creator>goodeats2009</dc:creator>
			<guid isPermaLink="false">121565@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>hi,  how can i keep track of an array of sprites after they are created, like their individual positions.  here is my code:<br />
<pre><code>-(void) addEnemy
{
    static int nrOfEnemies=0;

    if (nrOfEnemies &#60;2)
    {//beg *1
&#60;strong&#62;&#60;/strong&#62;
        _enemySprite = [EnemySprite spriteWithFile:@&#34;seeker.png&#34;];
        NSMutableArray *enemySprites = [NSMutableArray array];

        [enemySprites addObject:_enemySprite];

        _enemySprite.position = ccp(224,32+64*nrOfEnemies);
        [_bgMap addChild:_enemySprite z:10];
        nrOfEnemies++;
    }//end *1
    else
    {//beg *2
        [self unschedule:@selector(addEnemy)];
    }//end *2
}</code></pre>
<p>how do i store or query their individual positions like the enemySprite position at index:1 ,etc?<br />
i want to move them around but i can only query the last sprite created.  do i need another array to store their positions? if so, how?  thanks
</p></description>
		</item>
		<item>
			<title>greamer on "Pixel Art Tool"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/21893#post-121638</link>
			<pubDate>Mon, 17 Oct 2011 13:25:51 +0000</pubDate>
			<dc:creator>greamer</dc:creator>
			<guid isPermaLink="false">121638@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hello</p>
<p>are there any good tool to make sprite art on mac?? i tried to create some with photoshop... its really hard with my ultra weak photoshop skill<br />
and is there any good tutorial on drawing sprites?
</p></description>
		</item>

	</channel>
</rss>

