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

		<item>
			<title>Bongeh on "Completely whiting out a sprite"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/16527#post-93178</link>
			<pubDate>Fri, 13 May 2011 15:07:32 +0000</pubDate>
			<dc:creator>Bongeh</dc:creator>
			<guid isPermaLink="false">93178@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hey, I'm trying to completely white out a sprite when it gets hit, the sprites are children of a batchnode.</p>
<p>Using this code, I can tint the sprite fully black, but I have to use the rgb value for white to get it back to being coloured. </p>
<pre><code>[self setColor:ccc3(0, 0, 0)];</code></pre>
<p>How can I fully white out the sprite, rather than black it out?
</p></description>
		</item>
		<item>
			<title>greenTeaGames on "Spell Checking with UITextChecker"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/29102#post-143395</link>
			<pubDate>Thu, 09 Feb 2012 04:33:21 +0000</pubDate>
			<dc:creator>greenTeaGames</dc:creator>
			<guid isPermaLink="false">143395@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hey, I'm trying to come up with a way to use UITextChecker to see if a word is a real word or not. This is for a word game I'm thinking of making, but I'm having trouble working with this class.</p>
<p>Here is a simple test that I made to see if UITextChecker worked or not:</p>
<p>In the init method of HelloWorldLayer.m of a fresh chipmunk physics template:<br />
<pre><code>// Spell check test:
        NSString* string1 = [NSString stringWithString:@&#34;This is a string with a misssspelled word.&#34;];
        NSString* preferredLang = [[UITextChecker availableLanguages] objectAtIndex:0];
        misspelledWord = [textChecker rangeOfMisspelledWordInString:string1 range:NSMakeRange(0, string1.length) startingAt:0 wrap:NO language:preferredLang];

        if (misspelledWord.location == NSNotFound) {
            NSLog(@&#34;No errors, YAY!&#34;);
        }
        else {
            NSLog(@&#34;String1: %@&#34;, string1);
            NSLog(@&#34;Mispelled word with location: %d, and length: %d&#34;, misspelledWord.location, misspelledWord.length);
        }</code></pre>
<p>and this in HelloWorldLayer.h:<br />
<pre><code>@interface HelloWorldLayer : CCLayer
{
	cpSpace *space;

    // Spell Check test variables:
    UITextChecker* textChecker;
    NSRange misspelledWord;
}</code></pre>
<p>I also imported these files in the header:<br />
<pre><code>#<a href='http://www.cocos2d-iphone.org/forum/tags/import'>import</a> &#60;UIKit/UIKit.h&#62;
#<a href='http://www.cocos2d-iphone.org/forum/tags/import'>import</a> &#60;UIKit/UITextChecker.h&#62;</code></pre>
<p>Other than these snippets, I have not changed the template at all. And this is what the console gives me:</p>
<p>Initializing Chipmunk v5.3.5 (Debug Enabled)<br />
Compile with -DNDEBUG defined to disable debug mode and runtime assertion checks<br />
2012-02-09 13:23:49.650 spell test and physics test[4902:10a03] String1: This is a string with a misssspelled word.<br />
2012-02-09 13:23:49.651 spell test and physics test[4902:10a03] Mispelled word with location: 0, and length: 0</p>
<p>I get the same result with no misspelled words. If anyone can tell me what I'm doing wrong, it would be greatly appreciated.</p>
<p>cocos2d version: 1.0.1<br />
Xcode version: 4.2
</p></description>
		</item>
		<item>
			<title>riq on "workaround for %33 texture memory bug"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/29121#post-143486</link>
			<pubDate>Thu, 09 Feb 2012 19:10:33 +0000</pubDate>
			<dc:creator>riq</dc:creator>
			<guid isPermaLink="false">143486@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>So,</p>
<p>If you didn't know, when you create a texture, iOS will allocate 33% more memory, presumably to have enough room in case mipmaps are needed.<br />
( <a href="http://www.cocos2d-iphone.org/forum/topic/23887#post-129097" rel="nofollow">http://www.cocos2d-iphone.org/forum/topic/23887#post-129097</a> )</p>
<p>But it is worth noting that this bug is only present on POT (Power Of Two) textures ( Mipmapping is only supported on POT textures ).<br />
So, in order to reduce memory, what you have to do is two create NPOT textures.</p>
<p>eg:<br />
If you are using a 2048x2048 textures, convert it into a 2048x2047 textures (and you will save 33% memory).<br />
In case you can't make it smaller, then make it bigger. eg:<br />
If you have a 2048x1024 texture, create a 2048x1025 texture.</p>
<p>If you are using cocos2d v1.0, then you have to edit <code>ccConfig.h</code> with:<br />
<pre><code>#<a href='http://www.cocos2d-iphone.org/forum/tags/define'>define</a> CC_TEXTURE_NPOT_SUPPORT 1</code></pre>
<p>If you are using v1.1 or v2.0, then you are OK, since they already support NPOT textures by default.</p>
<p>Ways to know if you are using POT / NPOT textures:<br />
<strong>A)</strong>  Parse your PNG, GIF, BMP, JPEG files with <code>file</code>:<br />
<pre><code>$ find . -name &#34;*.png&#34; -print0 &#124; xargs -0 file</code></pre>
<p><strong>B)</strong> Run this line of code and see your debug console:<br />
<pre><code>[[CCTextureCache sharedTextureCache] dumpCachedTextureInfo];</code></pre>
<p>Further info:<br />
<a href="https://devforums.apple.com/thread/113889?start=0&#038;tstart=0" rel="nofollow">https://devforums.apple.com/thread/113889?start=0&#038;tstart=0</a></p>
<p>Important: NPOT textures can't have mipmaps, and also they only accept GL_CLAMP_TO_EDGE in GL_TEXTURE_WRAP_{S,T}</p>
<p>Important 2: PVRTC (2bpp and 4bpp) textures can't be converted to NPOT
</p></description>
		</item>
		<item>
			<title>marciokoko on "z values"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/29139#post-143524</link>
			<pubDate>Thu, 09 Feb 2012 22:26:30 +0000</pubDate>
			<dc:creator>marciokoko</dc:creator>
			<guid isPermaLink="false">143524@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Im working on a game and the bacgrkound sprite is covering everything:</p>
<p>Scene calls<br />
background layer and adds it to z:1<br />
action layer and adds it to z:0</p>
<p>ActionLayer<br />
adds batchNode to z:0<br />
adds batch node sprites to z:2</p>
<p>BackgroundLayer<br />
adds bacgrkound image to z:0</p>
<p>why wouldn't this work?  why would the background image cover everything else?  its in the lowest z value, 0.
</p></description>
		</item>
		<item>
			<title>whitewidget on "CCSprite Problem with Blending when using Custom Drawing"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/29116#post-143461</link>
			<pubDate>Thu, 09 Feb 2012 16:23:46 +0000</pubDate>
			<dc:creator>whitewidget</dc:creator>
			<guid isPermaLink="false">143461@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I've been having problems with blending when using custom drawing code in my CCSprite. I modified CCSprite to take note of vertices like a grid, in order for me to move those vertices and distort the sprite. After doing so, whenever there's an image added to the scene before adding the modified sprite into the scene, their blending doesn't work. The transparent parts of the image becomes black and the modified sprite cannot overwrite them. I tried different blending modes on the modified sprite to no avail. I even put GL_DST_ALPHA but it just made my modified sprite completely disappear :&#124;</p>
<p>The grid code I used is taken from CocosDistort by piferrari</p>
<p>In my CCSprite, I just added this code to the init method:</p>
<blockquote><p>
-(void) initGridPoints<br />
{</p>
<p>    GLint width = texture_.contentSizeInPixels.width;<br />
    GLint height = texture_.contentSizeInPixels.height;<br />
    int i, j;<br />
    int k;<br />
    int m;</p>
<p>    if (_mass == NULL)<br />
    {<br />
        _mass = (MASS*) malloc(sizeof(MASS)*GRID_SIZE_X*GRID_SIZE_Y);<br />
        if (_mass == NULL)<br />
        {<br />
            fprintf(stderr,"Can't allocate memroy.\n");<br />
            exit(-1);<br />
        }<br />
    }</p>
<p>    k = 0;<br />
    for (i = 0; i &#60; GRID_SIZE_X; i++)<br />
        for (j = 0; j &#60; GRID_SIZE_Y; j++)<br />
        {<br />
            _mass[k].nail = (i == 0 &#124;&#124; j == 0 &#124;&#124; i == GRID_SIZE_X - 1<br />
                             &#124;&#124; j == GRID_SIZE_Y - 1);<br />
            _mass[k].x[0] = i/(GRID_SIZE_X - 1.0)*width;<br />
            _mass[k].x[1] = j/(GRID_SIZE_Y - 1.0)*height;<br />
            _mass[k].x[2] = -(CLIP_FAR - CLIP_NEAR)/2.0;</p>
<p>            _mass[k].v[0] = 0.0;<br />
            _mass[k].v[1] = 0.0;<br />
            _mass[k].v[2] = 0.0;</p>
<p>            _mass[k].t[0] = i/(GRID_SIZE_X - 1.0);<br />
            _mass[k].t[1] = j/(GRID_SIZE_Y - 1.0);</p>
<p>            k++;<br />
        }</p>
<p>    if (_spring == NULL)<br />
    {<br />
        _springCount = (GRID_SIZE_X - 1)*(GRID_SIZE_Y - 2)<br />
        + (GRID_SIZE_Y - 1)*(GRID_SIZE_X - 2);</p>
<p>        _spring = (SPRING *) malloc(sizeof(SPRING)*_springCount);<br />
        if (_spring == NULL)<br />
        {<br />
            fprintf(stderr, "rubber: Can't allocate memory.\n");<br />
            exit(-1);<br />
        }<br />
    }</p>
<p>    k = 0;<br />
    for (i = 1; i &#60; GRID_SIZE_X - 1; i++)<br />
        for (j = 0; j &#60; GRID_SIZE_Y - 1; j++)<br />
        {<br />
            m = GRID_SIZE_Y*i + j;<br />
            _spring[k].i = m;<br />
            _spring[k].j = m + 1;<br />
            _spring[k].r = (height - 1.0)/(GRID_SIZE_Y - 1.0);<br />
            k++;<br />
        }</p>
<p>    for (j = 1; j &#60; GRID_SIZE_Y - 1; j++)<br />
    {<br />
        for (i = 0; i &#60; GRID_SIZE_X - 1; i++)<br />
        {<br />
            m = GRID_SIZE_Y*i + j;<br />
            _spring[k].i = m;<br />
            _spring[k].j = m + GRID_SIZE_X;<br />
            _spring[k].r = (width - 1.0)/(GRID_SIZE_X - 1.0);<br />
            k++;<br />
        }<br />
    }</p>
<p>    for ( i = 0; i &#60; GRID_SIZE_Y - 1; i++ )<br />
    {<br />
        for ( j = 0; j &#60; GRID_SIZE_X - 1; j++ )<br />
        {<br />
            k = i * GRID_SIZE_X + j;<br />
            _indices[k * 6 + 0] = ( i     ) * GRID_SIZE_X + j;<br />
            _indices[k * 6 + 1] = ( i + 1 ) * GRID_SIZE_X + j;<br />
            _indices[k * 6 + 2] = ( i + 1 ) * GRID_SIZE_X + j + 1;<br />
            _indices[k * 6 + 3] = ( i     ) * GRID_SIZE_X + j;<br />
            _indices[k * 6 + 4] = ( i + 1 ) * GRID_SIZE_X + j + 1;<br />
            _indices[k * 6 + 5] = ( i     ) * GRID_SIZE_X + j + 1;<br />
        }<br />
    }<br />
}
</p></blockquote>
<p>And changed my draw method to:</p>
<blockquote><p>
-(void) draw<br />
{<br />
	[super draw];</p>
<p>	NSAssert(!usesBatchNode_, @"If CCSprite is being rendered by CCSpriteBatchNode, CCSprite#<a href='http://www.cocos2d-iphone.org/forum/tags/draw'>draw</a> SHOULD NOT be called");</p>
<p>	// Default GL states: GL_TEXTURE_2D, GL_VERTEX_ARRAY, GL_COLOR_ARRAY, GL_TEXTURE_COORD_ARRAY<br />
	// Needed states: GL_TEXTURE_2D, GL_VERTEX_ARRAY, GL_COLOR_ARRAY, GL_TEXTURE_COORD_ARRAY<br />
	// Unneeded states: -</p>
<p>	BOOL newBlend = blendFunc_.src != CC_BLEND_SRC &#124;&#124; blendFunc_.dst != CC_BLEND_DST;<br />
	if( newBlend )<br />
		glBlendFunc( blendFunc_.src, blendFunc_.dst );</p>
<p>#<a href='http://www.cocos2d-iphone.org/forum/tags/define'>define</a> kQuadSize sizeof(quad_.bl)<br />
	glBindTexture(GL_TEXTURE_2D, [texture_ name]);</p>
<p>	long offset = (long)&#38;quad_;</p>
<p>    int k = 0;<br />
    int i, j;<br />
    if(_mass == NULL) {<br />
        NSLog(@"mass is null");<br />
        return;<br />
    }</p>
<p>    for (i = 0; i &#60; GRID_SIZE_X - 1; i++)<br />
    {<br />
        for (j = 0; j &#60; GRID_SIZE_Y - 1; j++)<br />
        {<br />
            GLfloat vertices[]= {<br />
                _mass[k].x[0],_mass[k].x[1],_mass[k].x[2],<br />
                _mass[k + 1].x[0],_mass[k + 1].x[1],_mass[k + 1].x[2],<br />
                _mass[k + GRID_SIZE_Y + 1].x[0],_mass[k + GRID_SIZE_Y + 1].x[1],_mass[k + GRID_SIZE_Y + 1].x[2],<br />
                _mass[k + GRID_SIZE_Y].x[0],_mass[k + GRID_SIZE_Y].x[1],_mass[k + GRID_SIZE_Y].x[2]<br />
            };<br />
            GLfloat tex[]={<br />
                _mass[k].t[0], _mass[k].t[1],<br />
                _mass[k + 1].t[0], _mass[k + 1].t[1],<br />
                _mass[k + GRID_SIZE_Y + 1].t[0], _mass[k + GRID_SIZE_Y + 1].t[1],<br />
                _mass[k + GRID_SIZE_Y].t[0], _mass[k + GRID_SIZE_Y].t[1]<br />
            };</p>
<p>            glVertexPointer(3, GL_FLOAT, 0, vertices);</p>
<p>            glTexCoordPointer(2, GL_FLOAT, 0, tex);</p>
<p>            glDrawArrays(GL_TRIANGLE_FAN, 0, 4);</p>
<p>            k++;<br />
        }<br />
        k++;<br />
    }</p>
<p>	// vertex<br />
	NSInteger diff = offsetof( ccV3F_C4B_T2F, vertices);<br />
	//glVertexPointer(3, GL_FLOAT, kQuadSize, (void*) (offset + diff) );</p>
<p>	// color<br />
	diff = offsetof( ccV3F_C4B_T2F, colors);<br />
	glColorPointer(4, GL_UNSIGNED_BYTE, kQuadSize, (void*)(offset + diff));</p>
<p>	// tex coords<br />
	diff = offsetof( ccV3F_C4B_T2F, texCoords);<br />
	//glTexCoordPointer(2, GL_FLOAT, kQuadSize, (void*)(offset + diff));</p>
<p>	glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);</p>
<p>	if( newBlend )<br />
		glBlendFunc(CC_BLEND_SRC, CC_BLEND_DST);</p>
<p>#<a href='http://www.cocos2d-iphone.org/forum/tags/if'>if</a> CC_SPRITE_DEBUG_DRAW == 1<br />
	// draw bounding box<br />
	CGPoint vertices[4]={<br />
		ccp(quad_.tl.vertices.x,quad_.tl.vertices.y),<br />
		ccp(quad_.bl.vertices.x,quad_.bl.vertices.y),<br />
		ccp(quad_.br.vertices.x,quad_.br.vertices.y),<br />
		ccp(quad_.tr.vertices.x,quad_.tr.vertices.y),<br />
	};<br />
	ccDrawPoly(vertices, 4, YES);<br />
#elif CC_SPRITE_DEBUG_DRAW == 2<br />
	// draw texture box<br />
	CGSize s = self.textureRect.size;<br />
	CGPoint offsetPix = self.offsetPositionInPixels;<br />
	CGPoint vertices[4] = {<br />
		ccp(offsetPix.x,offsetPix.y), ccp(offsetPix.x+s.width,offsetPix.y),<br />
		ccp(offsetPix.x+s.width,offsetPix.y+s.height), ccp(offsetPix.x,offsetPix.y+s.height)<br />
	};<br />
	ccDrawPoly(vertices, 4, YES);<br />
#endif // CC_SPRITE_DEBUG_DRAW</p>
<p>}</p>
</blockquote></description>
		</item>
		<item>
			<title>Hemingway72 on "Cocos 2D slow vs native OpenGL"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/29105#post-143398</link>
			<pubDate>Thu, 09 Feb 2012 05:40:11 +0000</pubDate>
			<dc:creator>Hemingway72</dc:creator>
			<guid isPermaLink="false">143398@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hi All,</p>
<p>Does the overhead of using cocos 2D mean that I will never achieve the quality of animation compared to using native opengl?</p>
<p>I've been playing around creating a basic Breakout style game using cocos 2D. The ball movement is achieved through updating ball.position * delta (change in time) each iteration of the game loop.<br />
When I compare the look and feel of my animation to that achieved in Atari's own version of Breakout (free version on the app store) they are miles apart. Atari's animation has  very solid look and feel to it. Is there a trick that I have missed with cocos 2D, or is this just something we have to settle for?</p>
<p>Cheers,
</p></description>
		</item>
		<item>
			<title>Duckwit on "[?]Class A imports B, B needs to import A too..."</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/29119#post-143466</link>
			<pubDate>Thu, 09 Feb 2012 16:50:53 +0000</pubDate>
			<dc:creator>Duckwit</dc:creator>
			<guid isPermaLink="false">143466@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>This is one of those stupid technical problem that I should be able to solve by now, but being bogged down by work and struggling to find programming time I can't seem to figure this out. </p>
<p>Class A is a singleton, it receives input from the user interface using Interface Builder.<br />
Class B is a CCLayer subclass (HelloWorldLayer)</p>
<p>B needs to know about a to send it some data via a method.<br />
A needs to know about B to call some methods in it when it receives certain file data from the NSOpenPanel. </p>
<p>B #imports A<br />
But if A imports B there are problems - (circular importing)  </p>
<p>How should I properly reference each class?
</p></description>
		</item>
		<item>
			<title>neigaard on "Is it possible to mix RGBA8888 and RGBA4444 in the same scene/layer?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/29122#post-143489</link>
			<pubDate>Thu, 09 Feb 2012 19:28:56 +0000</pubDate>
			<dc:creator>neigaard</dc:creator>
			<guid isPermaLink="false">143489@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hi</p>
<p>I would like to use RGBA4444 in some of my PVR textures and RGBA8888 in others of my PVR textures. No as I understand it the PVR includes information about wether it is RGBA8888 or RGBA4444, but will cocos2d work well with this also reducing memory usage on the RGBA4444 textures and still render my RGBA8888 textures in lovely 32 bit?</p>
<p>Thank you<br />
Søren
</p></description>
		</item>
		<item>
			<title>DevSdk on "Adding a node always in front of the camera"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/29028#post-143144</link>
			<pubDate>Tue, 07 Feb 2012 21:46:46 +0000</pubDate>
			<dc:creator>DevSdk</dc:creator>
			<guid isPermaLink="false">143144@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hello,</p>
<p>I have a little question for a problem I'm not able to solve.</p>
<p>I apply some transformation matrixes to my active camera in the updateBeforeTransform. I would like to been able to put an arrow always on the center of the camera view. The arrow should not rotate with the camera (I mean, it should not rotate towards the camera, it's actually pointing on another object), but should always be visible on the center of the screen.</p>
<p>How can I achieve that?</p>
<p>Thank you!
</p></description>
		</item>
		<item>
			<title>duncan on "Simple blender to pod problem"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/29118#post-143465</link>
			<pubDate>Thu, 09 Feb 2012 16:49:21 +0000</pubDate>
			<dc:creator>duncan</dc:creator>
			<guid isPermaLink="false">143465@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hi,</p>
<p>Something that I've been working round, but now I would like to resolve is when I export an object from blender to a pod then into cocos3d I have -90 on the x rotation axis.</p>
<p>If I simply open up blender and export my file as a dae and then run the ColladaToPOd (2.09) version on my file with the settings set out at</p>
<p><a href="http://brenwill.com/2011/cocos3d-importing-converting-collada-to-pod/" rel="nofollow">http://brenwill.com/2011/cocos3d-importing-converting-collada-to-pod/</a></p>
<p>When i do the following</p>
<p>  CC3MeshNode* cube = (CC3MeshNode*)[self getNodeNamed: @"Cube"];<br />
    CC3Vector testRot = cube.rotation;</p>
<p>testRot.x is always -90 even though in blender it is 0</p>
<p>I've tested loading the pods from 3D Mashup and these have x set to -0.</p>
<p>Any ideas?</p>
<p>I'm obviously just missing something very basic.</p>
<p>Thanks in advance<br />
an ashamed Duncan.
</p></description>
		</item>
		<item>
			<title>noodlz on "Moving a sprite across multiple coordinates using CCSequence"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/29115#post-143460</link>
			<pubDate>Thu, 09 Feb 2012 16:21:53 +0000</pubDate>
			<dc:creator>noodlz</dc:creator>
			<guid isPermaLink="false">143460@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hello! Long time reader, first time poster.</p>
<p>I have a predefined set of coordinates which form a path stored in two NSMutableArrays (one containing the x values, one for the y values). There are roughly 40 sets of coordinates.</p>
<p>Below is the section of code I am currently using:</p>
<p>    id patrolAction;<br />
    int pat_x1, pat_y1;<br />
    CCSequence *moveSequence;</p>
<p>            for (int x = 0; x&#60;[patrolPathX1 count]; x++){</p>
<p>                pat_x1=[[patrolPathX1 objectAtIndex:x]intValue];<br />
                pat_y1=[[patrolPathY1 objectAtIndex:x]intValue];</p>
<p>                patrolAction = [CCMoveTo actionWithDuration:1.5 position:[self positionForTileCoord:CGPointMake((float) pat_x1, (float) pat_y1)]]; </p>
<p>                moveSequence = [CCSequence actions:patrolAction, nil];</p>
<p>                [enemy2 runAction:moveSequence];<br />
            }</p>
<p>The aim is to get the sprite (enemy2) to move along this predefined path, however the sprite is just moving across to the final set of coordinates straight away. When I take out the for loop and hardcode them individually, it works fine. </p>
<p>(When I put the "runAction" outside of the for loop, the same effect is produced)</p>
<p>I have tried putting in a CCDelayTime in the sequence, yet this doesn't seem to help. </p>
<p>Can anyone help me out with this issue? </p>
<p>Thanks in advance :)
</p></description>
		</item>
		<item>
			<title>Stepan Generalov on "AutoMagicCoding (AMC) - alternative to NSCoding"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/20528#post-114140</link>
			<pubDate>Sat, 03 Sep 2011 09:49:21 +0000</pubDate>
			<dc:creator>Stepan Generalov</dc:creator>
			<guid isPermaLink="false">114140@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hello everybody!</p>
<p>I'm trying to create some alternative to NSCoding, that will have this features:<br />
1. It will be more automatic. Ideally - you will need to implement only ony class method for your custom class that returns YES to enable AMC.<br />
2. It will be saved as dictionaryRepresentation in PLIST in human readable format.<br />
Like this: <a href="http://dl.getdropbox.com/u/1765875/AMC.png" rel="nofollow">http://dl.getdropbox.com/u/1765875/AMC.png</a></p>
<p>Scalars tests passed on both Mac/iOS.<br />
Collections tests created normal PLIST file, but looks like it wasn't decoded from PLIST good.<br />
Structs tests are on the way.</p>
<p>I use TDD for it.</p>
<p>Here's a link (recently commited on collections branch, but develop should be main ):<br />
<a href="https://github.com/psineur/NSObject-AutomagicCoding" rel="nofollow">https://github.com/psineur/NSObject-AutomagicCoding</a>
</p></description>
		</item>
		<item>
			<title>FBryant on "[GAME] Evil Gnomes"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/29054#post-143320</link>
			<pubDate>Wed, 08 Feb 2012 21:12:54 +0000</pubDate>
			<dc:creator>FBryant</dc:creator>
			<guid isPermaLink="false">143320@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>First I'd just like to give a massive thanks to everyone here within the Cocos2d community. So a big thumbs up to everyone who contributes to the forum, and special thanks to Riq and Araker. Also a shout out to mrdckx for help during testing, and Ray Wenderlich as he seemed to have a tutorial for literally EVERY issue I encountered.</p>
<p>I hope you can all spare a moment to check out my Tower Defense game:</p>
<p><img src="http://img684.imageshack.us/img684/9416/shot1d.png" /> </p>
<p><img src="http://img816.imageshack.us/img816/6711/shot2y.png" /> </p>
<p>Build towers, collect resources, call upon alliances, and use magic to defeat wave after wave of the Evil Gnomes!</p>
<p>Unlock a broad range of features as you journey through the challenging levels. Very few will reach the Gold Stages, even fewer will beat them!</p>
<p>+ 3 Schools of Magic.<br />
+ 18 Unique Combat Towers.<br />
+ Multiple Upgrades for each Tower.<br />
+ Various Enemies with special abilities.<br />
+ Resource gathering system.<br />
+ Controllable friendly gnomes.<br />
+ Spell casting.</p>
<p>App Store: <a href="http://itunes.apple.com/us/app/evil-gnomes/id498798653?ls=1&#038;mt=8" rel="nofollow">http://itunes.apple.com/us/app/evil-gnomes/id498798653?ls=1&#038;mt=8</a></p>
<p>Video: <a href="http://www.youtube.com/watch?v=YMFAYdFCcEI&#038;feature=youtu.be" rel="nofollow">http://www.youtube.com/watch?v=YMFAYdFCcEI&#038;feature=youtu.be</a></p>
<p>PXWXNM9L9XLX<br />
KFH6NXTEYR7A<br />
WFNH7LRRF3J4</p>
<p>I'll be taking a break from development for a while, but I'll still try help out on here as much as I can. I owe it to the community after all... :)</p>
<p>Thanks.
</p></description>
		</item>
		<item>
			<title>jptsetung on "CCSpriteBatchNode and CCSprite"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/29113#post-143437</link>
			<pubDate>Thu, 09 Feb 2012 13:05:42 +0000</pubDate>
			<dc:creator>jptsetung</dc:creator>
			<guid isPermaLink="false">143437@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I'm thinking about extending the CCSpriteBatchNode to support more complex forms of sprites.<br />
For example, a CCSpriteBatchNode that would support CCProgressTimer, CCMotionStreak, etc...<br />
My understanding of opengl is not good enough to be sure we can do this.</p>
<p>Is it possible to build something like this? I don't really know how the sprite batch node works, but maybe this new batch node could rely on a protocol that the extensions (CCProgressTimer, etc... )  should have to implement in order they are compatible with the batch node drawings?
</p></description>
		</item>
		<item>
			<title>TheCodeTroll on "CCprogressTimer blues! Unable to use Sprite Sheets?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/29021#post-143088</link>
			<pubDate>Tue, 07 Feb 2012 18:01:52 +0000</pubDate>
			<dc:creator>TheCodeTroll</dc:creator>
			<guid isPermaLink="false">143088@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hey, so I'm using a progress timer, as a kind of energy /health representation.<br />
And all works very nicely, if i just use a single .png file, right from resources on its own.</p>
<p>But as I'm trying to save space, and keep things together nicely, I'm using sprite sheets for everything.<br />
Which also, is working very nicely. The only problem is I can't get the progress timer to work, AT ALL<br />
With a frame from my tile sheet...</p>
<p>I can initWithTexture, and give it the tile sheet, but as expected it uses the whole sheet as the sprite.<br />
I wrote an init with spriteFrameName method for the CCProgressTimer class,<br />
Where I Init self.sprite with the [CCSprite spriteWithSpriteFrameName: ]; method...<br />
But this doesnt work either, The sprite is returned, as there is data in self.sprite, but it wont draw it.<br />
I also went back and tried it by initialising with a dummy image, and then calling [progressTime setSprite:];<br />
but even calling that and setting it to a sprite that came from the sprite sheet ISNT WORKING :&#124;<br />
is there any reason at all that the class does this / was designed this way O_o?</p>
<p>I apreciate any input help, or advice... thanks :/
</p></description>
		</item>
		<item>
			<title>Ap3x on "Need help to update tweejump sourcecode to 1.xx"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28885#post-142361</link>
			<pubDate>Thu, 02 Feb 2012 19:17:15 +0000</pubDate>
			<dc:creator>Ap3x</dc:creator>
			<guid isPermaLink="false">142361@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>hello,<br />
i'm using xcode 4 and cocos2d 1.01 and<br />
i have a problem with the tweejump project.</p>
<p>this is the code from the original project:</p>
<p>---------------------------------------------<br />
#<a href='http://www.cocos2d-iphone.org/forum/tags/import'>import</a> "Highscores.h"<br />
#<a href='http://www.cocos2d-iphone.org/forum/tags/import'>import</a> "Main.h"<br />
#<a href='http://www.cocos2d-iphone.org/forum/tags/import'>import</a> "Game.h"</p>
<p>@interface Highscores (Private)<br />
- (void)loadCurrentPlayer;<br />
- (void)loadHighscores;<br />
- (void)updateHighscores;<br />
- (void)saveCurrentPlayer;<br />
- (void)saveHighscores;<br />
- (void)button1Callback:(id)sender;<br />
- (void)button2Callback:(id)sender;<br />
@end</p>
<p>@implementation Highscores</p>
<p>- (id)initWithScore:(int)lastScore {<br />
//	NSLog(@"Highscores::init");</p>
<p>	if(![super init]) return nil;</p>
<p>//	NSLog(@"lastScore = %d",lastScore);</p>
<p>	currentScore = lastScore;</p>
<p>//	NSLog(@"currentScore = %d",currentScore);</p>
<p>	[self loadCurrentPlayer];<br />
	[self loadHighscores];<br />
	[self updateHighscores];<br />
	if(currentScorePosition &#62;= 0) {<br />
		[self saveHighscores];<br />
	}</p>
<p>	AtlasSpriteManager *spriteManager = (AtlasSpriteManager*)[self getChildByTag:kSpriteManager];</p>
<p>	AtlasSprite *title = [AtlasSprite spriteWithRect:CGRectMake(608,192,225,57) spriteManager:spriteManager];<br />
	[spriteManager addChild:title z:5];<br />
	title.position = ccp(160,420);</p>
<p>	float start_y = 360.0f;<br />
	float step = 27.0f;<br />
	int count = 0;<br />
	for(NSMutableArray *highscore in highscores) {<br />
		NSString *player = [highscore objectAtIndex:0];<br />
		int score = [[highscore objectAtIndex:1] intValue];</p>
<p>		Label *label1 = [Label labelWithString:[NSString stringWithFormat:@"%d",(count+1)] dimensions:CGSizeMake(30,40) alignment:UITextAlignmentRight fontName:@"Arial" fontSize:14];<br />
		[self addChild:label1 z:5];<br />
		[label1 setRGB:0 :0 :0];<br />
		[label1 setOpacity:200];<br />
		label1.position = ccp(15,start_y-count*step-2.0f);</p>
<p>		Label *label2 = [Label labelWithString:player dimensions:CGSizeMake(240,40) alignment:UITextAlignmentLeft fontName:@"Arial" fontSize:16];<br />
		[self addChild:label2 z:5];<br />
		[label2 setRGB:0 :0 :0];<br />
		label2.position = ccp(160,start_y-count*step);</p>
<p>		Label *label3 = [Label labelWithString:[NSString stringWithFormat:@"%d",score] dimensions:CGSizeMake(290,40) alignment:UITextAlignmentRight fontName:@"Arial" fontSize:16];<br />
		[self addChild:label3 z:5];<br />
		[label3 setRGB:0 :0 :0];<br />
		[label3 setOpacity:200];<br />
		label3.position = ccp(160,start_y-count*step);</p>
<p>		count++;<br />
		if(count == 10) break;<br />
	}</p>
<p>	MenuItem *button1 = [MenuItemImage itemFromNormalImage:@"playAgainButton.png" selectedImage:@"playAgainButton.png" target:self selector:@selector(button1Callback:)];<br />
	MenuItem *button2 = [MenuItemImage itemFromNormalImage:@"changePlayerButton.png" selectedImage:@"changePlayerButton.png" target:self selector:@selector(button2Callback:)];</p>
<p>	Menu *menu = [Menu menuWithItems: button1, button2, nil];</p>
<p>	[menu alignItemsVerticallyWithPadding:9];<br />
	menu.position = ccp(160,58);</p>
<p>	[self addChild:menu];</p>
<p>	return self;<br />
}</p>
<p>- (void)dealloc {<br />
//	NSLog(@"Highscores::dealloc");<br />
	[highscores release];<br />
	[super dealloc];<br />
}</p>
<p>- (void)loadCurrentPlayer {<br />
//	NSLog(@"loadCurrentPlayer");</p>
<p>	NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];</p>
<p>	currentPlayer = nil;<br />
	currentPlayer = [defaults objectForKey:@"player"];<br />
	if(!currentPlayer) {<br />
		currentPlayer = @"anonymous";<br />
	}</p>
<p>//	NSLog(@"currentPlayer = %@",currentPlayer);<br />
}</p>
<p>- (void)loadHighscores {<br />
//	NSLog(@"loadHighscores");</p>
<p>	NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];</p>
<p>	highscores = nil;<br />
	highscores = [[NSMutableArray alloc] initWithArray: [defaults objectForKey:@"highscores"]];<br />
#ifdef RESET_DEFAULTS<br />
	[highscores removeAllObjects];<br />
#endif<br />
	if([highscores count] == 0) {<br />
		[highscores addObject:[NSArray arrayWithObjects:@"tweejump",[NSNumber numberWithInt:1000000],nil]];<br />
		[highscores addObject:[NSArray arrayWithObjects:@"tweejump",[NSNumber numberWithInt:750000],nil]];<br />
		[highscores addObject:[NSArray arrayWithObjects:@"tweejump",[NSNumber numberWithInt:500000],nil]];<br />
		[highscores addObject:[NSArray arrayWithObjects:@"tweejump",[NSNumber numberWithInt:250000],nil]];<br />
		[highscores addObject:[NSArray arrayWithObjects:@"tweejump",[NSNumber numberWithInt:100000],nil]];<br />
		[highscores addObject:[NSArray arrayWithObjects:@"tweejump",[NSNumber numberWithInt:50000],nil]];<br />
		[highscores addObject:[NSArray arrayWithObjects:@"tweejump",[NSNumber numberWithInt:20000],nil]];<br />
		[highscores addObject:[NSArray arrayWithObjects:@"tweejump",[NSNumber numberWithInt:10000],nil]];<br />
		[highscores addObject:[NSArray arrayWithObjects:@"tweejump",[NSNumber numberWithInt:5000],nil]];<br />
		[highscores addObject:[NSArray arrayWithObjects:@"tweejump",[NSNumber numberWithInt:1000],nil]];<br />
	}<br />
#ifdef RESET_DEFAULTS<br />
	[self saveHighscores];<br />
#endif<br />
}</p>
<p>- (void)updateHighscores {<br />
//	NSLog(@"updateHighscores");</p>
<p>	currentScorePosition = -1;<br />
	int count = 0;<br />
	for(NSMutableArray *highscore in highscores) {<br />
		int score = [[highscore objectAtIndex:1] intValue];</p>
<p>		if(currentScore &#62;= score) {<br />
			currentScorePosition = count;<br />
			break;<br />
		}<br />
		count++;<br />
	}</p>
<p>	if(currentScorePosition &#62;= 0) {<br />
		[highscores insertObject:[NSArray arrayWithObjects:currentPlayer,[NSNumber numberWithInt:currentScore],nil] atIndex:currentScorePosition];<br />
		[highscores removeLastObject];<br />
	}<br />
}</p>
<p>- (void)saveCurrentPlayer {<br />
//	NSLog(@"saveCurrentPlayer");<br />
//	NSLog(@"currentPlayer = %@",currentPlayer);</p>
<p>	NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];</p>
<p>	[defaults setObject:currentPlayer forKey:@"player"];<br />
}</p>
<p>- (void)saveHighscores {<br />
//	NSLog(@"saveHighscores");</p>
<p>	NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];</p>
<p>	[defaults setObject:highscores forKey:@"highscores"];<br />
}</p>
<p>- (void)button1Callback:(id)sender {<br />
//	NSLog(@"button1Callback");</p>
<p>	Scene *scene = [[Scene node] addChild:[Game node] z:0];<br />
	TransitionScene *ts = [FadeTransition transitionWithDuration:0.5f scene:scene withColorRGB:0xffffff];<br />
	[[Director sharedDirector] replaceScene:ts];<br />
}</p>
<p>- (void)button2Callback:(id)sender {<br />
//	NSLog(@"button2Callback");</p>
<p>	changePlayerAlert = [UIAlertView new];<br />
	changePlayerAlert.title = @"Change Player";<br />
	changePlayerAlert.message = @"\n";<br />
	changePlayerAlert.delegate = self;<br />
	[changePlayerAlert addButtonWithTitle:@"Save"];<br />
	[changePlayerAlert addButtonWithTitle:@"Cancel"];</p>
<p>	changePlayerTextField = [[UITextField alloc] initWithFrame:CGRectMake(20, 45, 245, 27)];<br />
	changePlayerTextField.borderStyle = UITextBorderStyleRoundedRect;<br />
	[changePlayerAlert addSubview:changePlayerTextField];<br />
//	changePlayerTextField.placeholder = @"Enter your name";<br />
//	changePlayerTextField.clearButtonMode = UITextFieldViewModeWhileEditing;<br />
	changePlayerTextField.keyboardType = UIKeyboardTypeDefault;<br />
	changePlayerTextField.returnKeyType = UIReturnKeyDone;<br />
	changePlayerTextField.autocorrectionType = UITextAutocorrectionTypeNo;<br />
	changePlayerTextField.autocapitalizationType = UITextAutocapitalizationTypeNone;<br />
	changePlayerTextField.delegate = self;<br />
	[changePlayerTextField becomeFirstResponder];</p>
<p>	[changePlayerAlert show];<br />
}</p>
<p>- (void)draw {<br />
//	NSLog(@"draw");</p>
<p>	if(currentScorePosition &#60; 0) return;</p>
<p>	glColor4ub(0,0,0,50);</p>
<p>	float w = 320.0f;<br />
	float h = 27.0f;<br />
	float x = (320.0f - w)/2;<br />
	float y = 359.0f - currentScorePosition * h;</p>
<p>	GLfloat vertices[4][2];<br />
	GLubyte indices[4] = { 0, 1, 3, 2 };</p>
<p>	glVertexPointer(2, GL_FLOAT, 0, vertices);<br />
	glEnableClientState(GL_VERTEX_ARRAY);</p>
<p>	vertices[0][0] = x;		vertices[0][1] = y;<br />
	vertices[1][0] = x+w;	vertices[1][1] = y;<br />
	vertices[2][0] = x+w;	vertices[2][1] = y+h;<br />
	vertices[3][0] = x;		vertices[3][1] = y+h;</p>
<p>	glDrawElements(GL_TRIANGLE_STRIP, 4, GL_UNSIGNED_BYTE, indices);</p>
<p>	glDisableClientState(GL_VERTEX_ARRAY);<br />
}</p>
<p>- (void)changePlayerDone {<br />
	currentPlayer = [changePlayerTextField.text retain];<br />
	[self saveCurrentPlayer];<br />
	if(currentScorePosition &#62;= 0) {<br />
		[highscores removeObjectAtIndex:currentScorePosition];<br />
		[highscores addObject:[NSArray arrayWithObjects:@"tweejump",[NSNumber numberWithInt:0],nil]];<br />
		[self saveHighscores];<br />
		Highscores *h = [[Highscores alloc] initWithScore:currentScore];<br />
		Scene *scene = [[Scene node] addChild:h z:0];<br />
		[[Director sharedDirector] replaceScene:[FadeTransition transitionWithDuration:1 scene:scene withColorRGB:0xffffff]];<br />
	}<br />
}</p>
<p>- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex {<br />
//	NSLog(@"alertView:clickedButtonAtIndex: %i",buttonIndex);</p>
<p>	if(buttonIndex == 0) {<br />
		[self changePlayerDone];<br />
	} else {<br />
		// nothing<br />
	}<br />
}</p>
<p>- (BOOL)textFieldShouldReturn:(UITextField *)textField {<br />
//	NSLog(@"textFieldShouldReturn");<br />
	[changePlayerAlert dismissWithClickedButtonIndex:0 animated:YES];<br />
	[self changePlayerDone];<br />
	return YES;<br />
}</p>
<p>@end</p>
<p>------------------------------------------------</p>
<p>ok, i know that Sprite is CCSprite and AtlasSpriteManager is CCSpriteBatchNode, thats not the problem.<br />
but the - (void)button1Callback:(id)sender and - (void)changePlayerDone just do not work.</p>
<p>i changed them to this:</p>
<p>--------------------------------------<br />
- (void)button1Callback:(id)sender {<br />
    //	NSLog(@"button1Callback");</p>
<p>	CCScene *scene = [[CCScene node] addChild:[Game node] z:0];<br />
	CCTransitionScene *ts = [CCTransitionFade transitionWithDuration:0.5f scene:scene withColorRGB:0xffffff];<br />
	[[CCDirector sharedDirector] replaceScene:ts];<br />
}<br />
--------------------------------------</p>
<p>and this:</p>
<p>--------------------------------------<br />
- (void)changePlayerDone {<br />
	currentPlayer = [changePlayerTextField.text retain];<br />
	[self saveCurrentPlayer];<br />
	if(currentScorePosition &#62;= 0) {<br />
		[highscores removeObjectAtIndex:currentScorePosition];<br />
		[highscores addObject:[NSArray arrayWithObjects:@"tweejump",[NSNumber numberWithInt:0],nil]];<br />
		[self saveHighscores];<br />
		Highscores *h = [[Highscores alloc] initWithScore:currentScore];<br />
		CCScene *scene = [[CCScene node] addChild:h z:0];<br />
		[[CCDirector sharedDirector] replaceScene:[CCTransitionFade transitionWithDuration:1 scene:scene withColorRGB:0xffffff]];<br />
	}<br />
}<br />
--------------------------------------</p>
<p>but it doesn't work -.-<br />
can someone pls say me, how to change the methods or/and where my mistakes are?
</p></description>
		</item>
		<item>
			<title>fuzz on "Trimming final app size"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/29117#post-143462</link>
			<pubDate>Thu, 09 Feb 2012 16:33:26 +0000</pubDate>
			<dc:creator>fuzz</dc:creator>
			<guid isPermaLink="false">143462@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Im trying to keep my app under 20 megs, currently the zipped release compiled app sits at 22,1 megs, but my images, sounds, classes and extras comes to 15 megs. Are the rest from cocos2d's libraries? Is there a way to check what the finished app contains?
</p></description>
		</item>
		<item>
			<title>nffdiogosilva on "[SpaceManager] EXEC_BAD_ACCESS When Touching a sprite that has a collision"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/29120#post-143467</link>
			<pubDate>Thu, 09 Feb 2012 16:54:46 +0000</pubDate>
			<dc:creator>nffdiogosilva</dc:creator>
			<guid isPermaLink="false">143467@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hello there. I'm new to Cocos2D and still giving the first steps. But, i'm having this bug:</p>
<p>Here's the code:</p>
<blockquote><p>
-(void) removeAndMaybeFreeShape:(cpShape*)shape freeShape:(BOOL)freeShape<br />
{</p>
<p>if (shape-&#62;body-&#62;m == STATIC_MASS)<br />
cpSpaceRemoveStaticShape(_space, shape);<br />
else<br />
cpSpaceRemoveShape(_space, shape);</p>
<p>//Make sure it's not our static body<br />
if (shape-&#62;body != &#38;_space-&#62;staticBody)<br />
{<br />
//Checking if this body is shared....!<br />
BOOL shared = NO;</p>
<p>//anyone else have this body?<br />
for(cpShape *sh = shape-&#62;body-&#62;shapesList; sh &#38;&#38; !shared; sh=sh-&#62;next)<br />
shared = (sh != shape);</p>
<p>//if not then get rid of it<br />
if (!shared)<br />
[self removeAndMaybeFreeBody:shape-&#62;body freeBody:freeShape];<br />
}</p>
<p>if (freeShape)<br />
cpShapeFree(shape);<br />
}</p>
</blockquote>
<p>I have a body that is colliding ("eating") with another one. But the user might press him for some reason, and if that happens that app crashes sayin': EXEC_BAD_ACCESS, on this line:</p>
<blockquote><p>
if (shape-&#62;body-&#62;m == STATIC_MASS)</p>
</blockquote>
<p>What should i do to prevent the body of being released if it is on a collision?</p>
<p>P.S.: Sorry for posting something that has already a thread but nobody would answer me.
</p></description>
		</item>
		<item>
			<title>Japps on "Need help with basics.. draw sprite on multiple locations"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28970#post-142785</link>
			<pubDate>Sun, 05 Feb 2012 22:06:23 +0000</pubDate>
			<dc:creator>Japps</dc:creator>
			<guid isPermaLink="false">142785@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I'm new to Cocos2d and Objective c and have trouble to understand a very basic thing with Cocos2d, how to draw the same sprite on multiple locations...</p>
<p>If I have a CCSprite *mySprite, and I want to draw this multiple times it seems I can only add this one time to the layer? Is there no way to for example do mySprite.drawAt(x, y) in the main draw function?
</p></description>
		</item>
		<item>
			<title>Zach Winkler on "Changing Color of MeshNode"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/29096#post-143376</link>
			<pubDate>Thu, 09 Feb 2012 00:11:09 +0000</pubDate>
			<dc:creator>Zach Winkler</dc:creator>
			<guid isPermaLink="false">143376@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hello, I am very new to cocos3d. What I am trying to do is load my model which consists of many meshes (about 20) but I only want to change the color of one of the meshes. When I get the fullDescription of the mesh that I am trying to color, it is the correct one, but when I try to color it, it changes the color of the entire model. The weird thing is that if I call a RotateBy on the same mesh, only that mesh moves. I have tried using setColor and TintTo and both are changing the color of the entire model. Am I missing something simple?</p>
<p>Thank you
</p></description>
		</item>
		<item>
			<title>SmallMike on "popScene with Transition"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/1076#post-6473</link>
			<pubDate>Sun, 02 Aug 2009 23:44:53 +0000</pubDate>
			<dc:creator>SmallMike</dc:creator>
			<guid isPermaLink="false">6473@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Is there any way to perform a transition when popping a scene? I can't seem to find any indication of how this might be done. Obviously I can just use replaceScene with a transition, but the push / pop mechanism works really well for how I have my menus/game organized.</p>
<p>- Mike
</p></description>
		</item>
		<item>
			<title>rickms on "[GAME] The B.E.A.T. - Rhythm Game Played With YOUR OWN Music!"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/29052#post-143308</link>
			<pubDate>Wed, 08 Feb 2012 18:36:35 +0000</pubDate>
			<dc:creator>rickms</dc:creator>
			<guid isPermaLink="false">143308@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hi All,</p>
<p>I'd like to introduce you all to my latest cocos2d based game now on the App Store, &#60;stong&#62;The B.E.A.T.   The B.E.A.T. differs from other games in the genre because it allows you to play a rhythm game to the music in your own library rather than pre-packaged song.</p>
<p>From a developers stand point, coordinating real time DSP into an iphone app was a fun and interesting challenge but one that allows for a great variety of game play.  cocos2d made creating the game on top of that technology one of the easier parts of The B.E.A.T.'s development!</p>
<p>Here is a game play video to show you the feel of the game, screenshots really don't do it justice!</p>
<p><a href="http://www.youtube.com/watch?v=LurQJAivqVE" rel="nofollow">http://www.youtube.com/watch?v=LurQJAivqVE</a></p>
<p>More details can be found our webstite <a href="http://tiredeyesentertainment.com/games/thebeat/">The B.E.A.T.</a></p>
<p>Or you can get it directly at @ <a href="http://itunes.apple.com/us/app/the-b.e.a.t./id488333292">The B.E.A.T. in the App Store</a></p>
<p>Thanks go out to riq and the cocos2d team for maintaining a great library!<br />
 Also thanks to fellow cocos2d devs QcMat and ubert for listening to me rant in IRC about the various issues that came up during development :)
</p></description>
		</item>
		<item>
			<title>Gillies on "[GAME] Sir Benfro&#039;s Brilliant Balloon - Promo Codes"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28852#post-142154</link>
			<pubDate>Wed, 01 Feb 2012 15:24:06 +0000</pubDate>
			<dc:creator>Gillies</dc:creator>
			<guid isPermaLink="false">142154@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I have just completed my first game based on cocos2d for iPhone and iPad.<br />
It was developed in collaboration with Tim Fishlock who developed the main character and art style - <a href="http://www.timfishlock.com/" rel="nofollow">http://www.timfishlock.com/</a><br />
Tom Colvin created the music and sound effects.<br />
I have spent 1 year designing, programming, scripting, creating art assets, animating, shipping and creating the trailer.<br />
Far more work than any of us expected.</p>
<p>It's a single touch game but with, I think, a unique mechanic.<br />
Rate of touch allows the player to control the speed of Sir Benfro.</p>
<p><a href="http://www.youtube.com/watch?v=6nOg5rDWkZ8" rel="nofollow">http://www.youtube.com/watch?v=6nOg5rDWkZ8</a></p>
<p>The game website is here:<br />
<a href="http://www.sirbenfro.com/" rel="nofollow">http://www.sirbenfro.com/</a></p>
<p>You can download it here:<br />
<a href="http://itunes.apple.com/gb/app/sir-benfros-brilliant-balloon/id475711411?mt=8" rel="nofollow">http://itunes.apple.com/gb/app/sir-benfros-brilliant-balloon/id475711411?mt=8</a></p>
<p>Thank you all for your support - cocos2d is a great product and it's a great community.<br />
Thank you Riq! </p>
<p>Here are some codes:<br />
RE3NMW69RAJP<br />
KTMKNY649RW7<br />
HMFFL6FWJ46P</p>
<p>Any feedback on the game would be much appreciated.<br />
Thank you folks.</p>
<p>Giles<br />
<a href="http://www.exploreandcreate.com/" rel="nofollow">http://www.exploreandcreate.com/</a>
</p></description>
		</item>
		<item>
			<title>Vanny on "Pointers and properly disposing of objects"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/29097#post-143381</link>
			<pubDate>Thu, 09 Feb 2012 01:52:10 +0000</pubDate>
			<dc:creator>Vanny</dc:creator>
			<guid isPermaLink="false">143381@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I'm getting memory errors and it's probably because of a lack of understanding pointers. I have an instance variable in my game layer that is of a projectile class I made. The projectile has a box2d body and a CCsprite.</p>
<p>So every time a player shoots using an end touch a new projectile is created/assigned to the instance variable, box2d body and all. The reason I assign it to the instance variable is because I need access to that single projectile in other methods to aim and manipulate it for my game. I'm detecting collisions with the projectile, adding to a toDestroy array and removing the ccsprite and body from the scene. Every once in a while I get a memory error when I try to add a new projectile to the layer. Should I not be reusing the instance variable to create objects that remain in the scene?</p>
<p>My error happens occasionally when the game tries to add a new projectile body. Not sure how there is a memory issue creating something new.</p>
<p>Sorry I don't have code it would pretty much be the entire game. I'm more looking for programming concepts.<br />
Any best practices I should follow to create, change and dispose of projectiles?
</p></description>
		</item>
		<item>
			<title>Arbel on "Ways to reduce sound lag"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28230#post-138891</link>
			<pubDate>Tue, 10 Jan 2012 11:50:27 +0000</pubDate>
			<dc:creator>Arbel</dc:creator>
			<guid isPermaLink="false">138891@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I am making a music game and when the user presses a note it will produce a sound. The sound naturally needs to play immediately when the user presses, so they can tell whether they are in time with the music. However, it feels as if the sound is lagging, especially when note presses become quicker.</p>
<p>My background .m4a music file is played with AVAudioPlayer. I chose to use this as I have access to the currentTime property. I may be wrong, but I dont think I can access this with CocosDenshion.</p>
<p>I made a .wav file which is extremely short (a few hundred milliseconds). I preload my sound effect on init:</p>
<pre><code>[[SimpleAudioEngine sharedEngine] preloadEffect:@&#34;Assist.wav&#34;];</code></pre>
<p>Then to play the sound effect, in CCTouchesBegan I call:<br />
<pre><code>[[SimpleAudioEngine sharedEngine] playEffect:@&#34;Assist.wav&#34;];</code></pre>
<p>After that it calls my code to determine the users timing and awards points. Any idea why it might be lagging, or a better way to play sound effects in time with music?
</p></description>
		</item>
		<item>
			<title>devindazzle on "3d in Cocos2d v2.0"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/29049#post-143253</link>
			<pubDate>Wed, 08 Feb 2012 11:55:26 +0000</pubDate>
			<dc:creator>devindazzle</dc:creator>
			<guid isPermaLink="false">143253@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I love how simple it is to create games with Cocos2d. I know it is a 2d engine but I have started to wonder if it would not be possible to actually include 3d models etc in Cocos2d (like done i fx New Super Mario Wii and many other games).</p>
<p>I have seen a few forum topics covering methods to use 3d in Cocos2d but I did not really understand fully what would make it difficult to do 3d in the draw method of a CCNode or similar as it gives access to the GL Context.</p>
<p>Now, if I want to start adding my 3d assets to a cocos2d game I need to know exactly how the GL context is set up and of cause how to reset state it again to ensure proper functionality of cocos2d. Can anyone explain what is actually needed to efficiently enable 3d drawing? What flags are set per default in Cocos2d v2.0 (I assume the depth buffer is not enabled and that orthographic projection is used). Is this true?</p>
<p>Hope to have some pointers from more experienced users :)
</p></description>
		</item>
		<item>
			<title>Mister_Cheese on "cocos3d  problem creating exporting POD files from 3DS Max"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28872#post-142261</link>
			<pubDate>Thu, 02 Feb 2012 07:23:25 +0000</pubDate>
			<dc:creator>Mister_Cheese</dc:creator>
			<guid isPermaLink="false">142261@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I am having problems exporting an animated textured model created in 3Ds max.    I have several models all giving similar results (with 1 model working properly)</p>
<p>I go about it 2 different ways which give me 2 different results.<br />
Method 1.  I export to a COLLADA .dae file and use Collada2POD v2.09 to convert that to a POD and load it into my cocos3d scene following the instructions at: <a href="http://brenwill.com/2011/cocos3d-importing-converting-collada-to-pod/" rel="nofollow">http://brenwill.com/2011/cocos3d-importing-converting-collada-to-pod/</a><br />
This normally results in some whacky animations with the texture looking normal most of the time.</p>
<p>Method 2.  Using the PVRGeoPOD plugin for max, I export directly to POD file.  This results in proper animations in the cocos3d scene, however the character shows up as all either all black or just 1 or two parts of him are textured.  </p>
<p>I do have 1 model that turned out properly when going the max-&#62;dae-&#62;pod route.  Other then that I have not been having any luck.<br />
Anyone know what might be causing this?</p>
<pre><code>pod = [CC3PODResourceNode nodeWithName: @&#34;LearningCompanionAnimation&#34;];
    pod.resource = [CC3PODResource resourceFromResourceFile:[NSString stringWithFormat:@&#34;guy05.pod&#34;]];

    pod.shouldUseLighting = NO;

    [self addChild:pod];

    CCActionInterval* LCLoop = [CC3Animate actionWithDuration: 6 limitFrom: 0.0 to: 1];
    [pod runAction: LCLoop];</code></pre></description>
		</item>
		<item>
			<title>bobueland on "[Course Announcement] Cocos2d course"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28821#post-141994</link>
			<pubDate>Tue, 31 Jan 2012 13:09:34 +0000</pubDate>
			<dc:creator>bobueland</dc:creator>
			<guid isPermaLink="false">141994@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I am designing a complete <a href="http://bobueland.com/cocos2d/?page_id=400">cocos2d course</a>. There is now an <a href="http://bobueland.com/cocos2d/?page_id=450">early bird option</a>  open until the 11:th of Februari 2012.</p>
<p>Thanks<br />
Bob Ueland
</p></description>
		</item>
		<item>
			<title>Mister_Cheese on "Animated pod file, objects disappearing."</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/29023#post-143098</link>
			<pubDate>Tue, 07 Feb 2012 18:23:39 +0000</pubDate>
			<dc:creator>Mister_Cheese</dc:creator>
			<guid isPermaLink="false">143098@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I have an pod file of an animated character created in max and have been having an issue where parts of his body will disappear, or the animation will go funky.  ie His hat will at his neck instead of on his head.</p>
<p>I use the following code to load the model and start the animation.<br />
<pre><code>CC3MeshNode* mn;
CC3ResourceNode* rezNode;
rezNode = [CC3PODResourceNode nodeFromResourceFile:@&#34;Learning_Companion_Anim_Ambient01.POD&#34;];
mn = (CC3MeshNode*)[rezNode getNodeNamed: @&#34;Dummy01&#34;];
mn.isOpaque = NO;
[self addChild:mn];
CCActionInterval* LCLoop = [CC3Animate actionWithDuration: kAnimationTime limitFrom: 0.0 to: 1.0];
[mn runAction: [CCRepeatForever actionWithAction:LCLoop]];</code></pre>
<p>After some messing around, I have discovered that using OpenEars, an open source library for voice recognition <a href="http://www.politepix.com/openears" rel="nofollow">http://www.politepix.com/openears</a>   It seems to be the cause for parts of the body disappearing.  If I never start openears from listening for audio input the model animates fine.  If the animation is never started with runAction, then the model appears correctly and none of his body parts are missing.</p>
<p>I was hoping someone might have some insight as to why this library would be messing up the animations running in cocos3d.  I also realize my chances at getting help on this are slim to none as the problem is stemming from conflicting libaries, so I would really appreciate any insight.</p>
<p>Thanks,<br />
Andrew
</p></description>
		</item>
		<item>
			<title>Stepan Generalov on "CCScrollLayer - Improved"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/17118#post-96422</link>
			<pubDate>Tue, 31 May 2011 01:59:03 +0000</pubDate>
			<dc:creator>Stepan Generalov</dc:creator>
			<guid isPermaLink="false">96422@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Original CCScrollLayer by DK101 &#38; Giv Parvaneh<br />
Added ability to swipe above targetedTouchDelegates.</p>
<p>Mac not supported. Tested with 1.0.0-rc3<br />
<a href="https://github.com/cocos2d/cocos2d-iphone-extensions/tree/develop/Extensions/CCScrollLayer" rel="nofollow">https://github.com/cocos2d/cocos2d-iphone-extensions/tree/develop/Extensions/CCScrollLayer</a>
</p></description>
		</item>

	</channel>
</rss>

