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

		<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>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>GoldenJoe on "[paid] Artist/Animator wanted to help me tear Angry Birds to shreds."</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/29008#post-142994</link>
			<pubDate>Tue, 07 Feb 2012 07:21:40 +0000</pubDate>
			<dc:creator>GoldenJoe</dc:creator>
			<guid isPermaLink="false">142994@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Are you tired of boring little trashy "flick and forget" games yet? I know I am. That's why I set out to prove that even with a concept as tired as Angry Birds, you can create gameplay that is easy to learn and challenging to master together with a presentation that is engaging and humorous. How about instead of making the player feel like an idiot because their three year old has more stars, giving the player a real gaming experience that takes skill to complete, and makes the player feel accomplished when they finally beat the final boss? Let's put the "GAME" back in "Mobile Games". </p>
<p>I've been developing a runner/action type game. Basically, this is the polar opposite of Angry Birds - you're a pig fighting off birds in a fast paced setting. The engine is almost completely done, I just need actual assets to progress. Lucky for you, my aspiring artists, I'm not half bad with a pen and pad, and am providing detailed sketches of every major frame for the player character, enemies, and environment. You will have to follow the art style I provide exactly. I'm looking for bold, saturated colors. Cartoony, but not entirely generic if you get my drift.</p>
<p>This game has some pretty cool stuff in it. The engine supports game speed modification (for example, bullet time), and has a fake camera that can be used to zoom the game environment in and out. Even the bosses have a unique finishing sequence. This is definitely a great opportunity for anyone interested in mobile games.</p>
<p>Obviously, I don't have the budget of a full studio since I've done this all in my spare time, but I'm willing to pay for quality. Send me a message or email (my user name @gmail.com) with the following. If I like what I see, I'll send you a simplified game doc so you can see all the enemies and such.</p>
<p>- examples of past work<br />
- your availability and rates<br />
- any references you may have<br />
- a brief description of your favorite portable game, and why it's your favorite<br />
- your reason for wanting to work on this game</p>
<p>Deliverables:<br />
- all frames in vector format (Illustrator)<br />
- a saved copy in .png format, optimized for the iOS retina display (such as Photoshop's "save for web and devices-&#62;24 bit png" option)</p>
<p>Oh, and I'll be looking for a music/sound guy soon enough. Tell your friends.
</p></description>
		</item>
		<item>
			<title>Anthony on "Help with a (simple?) animation question"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/29017#post-143052</link>
			<pubDate>Tue, 07 Feb 2012 16:30:45 +0000</pubDate>
			<dc:creator>Anthony</dc:creator>
			<guid isPermaLink="false">143052@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hi all,</p>
<p>I'm fairly new to Cocos2d and I've been reading a bunch of books and tutorials on the subject. </p>
<p>I'm in the process of making a game that will focus on rolling three dice and subsequently dragging those dice onto a 9x9 grid for scoring (this process will take place three times). I've written the code to drag and drop the dice, but I'm a bit clueless about two aspects of the game: what would be the best solution for animating the dice roll while being able to return the face-up value (sprite sheet? 3D?), and how would I drag the dice and "snap" them to a segment on the 9x9 grid while being able to return what segment the dice was snapped to? Thanks so much for your time and advice!</p>
<p>-A
</p></description>
		</item>
		<item>
			<title>riq on "New Animation format: delays and notifications per frame"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28734#post-141614</link>
			<pubDate>Sat, 28 Jan 2012 05:24:14 +0000</pubDate>
			<dc:creator>riq</dc:creator>
			<guid isPermaLink="false">141614@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hey,</p>
<p>So I updated the animation format.<br />
Now you can customize the delays per frame and also send notifications each time a frame is displayed.</p>
<p>Format:<br />
<pre><code>&#60;?xml version=&#34;1.0&#34; encoding=&#34;UTF-8&#34;?&#62;
&#60;!DOCTYPE plist PUBLIC &#34;-//Apple//DTD PLIST 1.0//EN&#34; &#34;http://www.apple.com/DTDs/PropertyList-1.0.dtd&#34;&#62;
&#60;plist version=&#34;1.0&#34;&#62;
&#60;dict&#62;
	&#60;key&#62;animations&#60;/key&#62;
	&#60;dict&#62;
		&#60;key&#62;dance_1&#60;/key&#62;
		&#60;dict&#62;
			&#60;key&#62;delay per unit&#60;/key&#62;
			&#60;real&#62;0.2&#60;/real&#62;
			&#60;key&#62;restore original frame&#60;/key&#62;
			&#60;true/&#62;
			&#60;key&#62;frames&#60;/key&#62;
			&#60;array&#62;
				&#60;dict&#62;
					&#60;key&#62;spriteframe&#60;/key&#62;
					&#60;string&#62;grossini_dance_01.png&#60;/string&#62;
					&#60;key&#62;delay units&#60;/key&#62;
					&#60;integer&#62;1&#60;/integer&#62;
					&#60;key&#62;notification&#60;/key&#62;
					&#60;dict&#62;
						&#60;key&#62;firstframe&#60;/key&#62;
						&#60;true/&#62;
					&#60;/dict&#62;
				&#60;/dict&#62;
				&#60;dict&#62;
					&#60;key&#62;spriteframe&#60;/key&#62;
					&#60;string&#62;grossini_dance_02.png&#60;/string&#62;
					&#60;key&#62;delay units&#60;/key&#62;
					&#60;integer&#62;1&#60;/integer&#62;
				&#60;/dict&#62;
				&#60;dict&#62;
					&#60;key&#62;spriteframe&#60;/key&#62;
					&#60;string&#62;grossini_dance_14.png&#60;/string&#62;
					&#60;key&#62;delay units&#60;/key&#62;
					&#60;integer&#62;1&#60;/integer&#62;
					&#60;key&#62;notification&#60;/key&#62;
					&#60;dict&#62;
						&#60;key&#62;lastframe&#60;/key&#62;
						&#60;true/&#62;
					&#60;/dict&#62;
				&#60;/dict&#62;
			&#60;/array&#62;
		&#60;/dict&#62;
	&#60;/dict&#62;
	&#60;key&#62;properties&#60;/key&#62;
	&#60;dict&#62;
		&#60;key&#62;spritesheets&#60;/key&#62;
		&#60;array&#62;
			&#60;string&#62;animations/grossini.plist&#60;/string&#62;
			&#60;string&#62;animations/grossini_family.plist&#60;/string&#62;
		&#60;/array&#62;
		&#60;key&#62;format&#60;/key&#62;
		&#60;integer&#62;2&#60;/integer&#62;
	&#60;/dict&#62;
&#60;/dict&#62;
&#60;/plist&#62;</code></pre>
<p>To listen to the notifications, you have to register an observer for <code>CCAnimationFrameDisplayedNotification</code>. eg:<br />
<pre><code>observer_ = [[NSNotificationCenter defaultCenter] addObserverForName:CCAnimationFrameDisplayedNotification object:nil queue:nil usingBlock:^(NSNotification* notification) {

		NSDictionary *userInfo = [notification userInfo];
		NSLog(@&#34;object %@ with data %@&#34;, [notification object], userInfo );
	}];</code></pre>
<p><code>userInfo</code> is the dictionary that is defined in the .plist, in the <code>notification</code> entry. If no <code>notification</code> entry is present, then no notifications will be sent.</p>
<p>For a working example, please try "ActionTest.m" and run the "Animation test":<br />
<a href="https://github.com/cocos2d/cocos2d-iphone/blob/d0ab4515a4736bdf31aaed6394d95f8ea02beea1/tests/ActionsTest.m#L536" rel="nofollow">https://github.com/cocos2d/cocos2d-iphone/blob/d0ab4515a4736bdf31aaed6394d95f8ea02beea1/tests/ActionsTest.m#L536</a>
</p></description>
		</item>
		<item>
			<title>Rocketman697 on "Interesting &quot;twist&quot; on importing camera animations from POD file"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28719#post-141550</link>
			<pubDate>Fri, 27 Jan 2012 16:42:21 +0000</pubDate>
			<dc:creator>Rocketman697</dc:creator>
			<guid isPermaLink="false">141550@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I have successfully created a scene in Maya, exported it with PVRGeoPOD and imported it into a cocos3d project.  The scene contains mesh and camera animations which I want to use in my project.  I found that the mesh animations worked perfectly, but camera animations were not oriented properly.</p>
<p>I have made no changes to the default axis in Maya, and mesh animations are working well, so it would be great if camera animations did as well.  I have some complex camera moves that would be hard to recreate in Xcode.  Though the workarounds I came up with do work, it would be better if cocos3d could import camera animations without need to make any changes.</p>
<p>To work around this issue, first I copied the camera animation to a mesh cube in Maya, then in Xcode I copied the mesh animation to the camera.  It worked perfectly!</p>
<p>Next, I wanted to see what was being changed, so I experimented with creating a structural node, making the camera a child, then moving the animation to the structural node.  This way I could rotate the camera independently of the animation.  Here's what I came up with:</p>
<pre><code>// Get the camera from the POD file
    camera1 = (CC3Camera*)[self getNodeNamed:@&#34;camera1&#34;];
    self.activeCamera = camera1;  

    // Put this camera under a parent node
    camParent = [[CC3Camera alloc] initWithName:@&#34;camParent&#34;];
    [self addChild:camParent];
    [camParent addChild:camera1];

    // *** HERE IS THE CAMERA ANGLE CORRECTION ***
    [camera1 rotateByAngle:-90 aroundAxis:CC3VectorMake(1, 0, 0)]; // The camera direction appears to be rotated from pointing to -z to y, rotate it back
    camParent.animation = camera1.animation; // Copy the animation to the parent node
    camera1.animation = NULL;

    // Run the animation from the POD file
    [camParent runAction: [CCRepeatForever actionWithAction:[CC3Animate actionWithDuration:10.0]]];</code></pre>
<p>So my question is this: Does PVRGeoPOD do this, and if so can it be corrected in the cocos3d import module?
</p></description>
		</item>
		<item>
			<title>callispo on "Cut the Rope style intro video"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28851#post-142149</link>
			<pubDate>Wed, 01 Feb 2012 14:55:45 +0000</pubDate>
			<dc:creator>callispo</dc:creator>
			<guid isPermaLink="false">142149@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I was wondering, the intro animation of Cut the Rope, in which theres a knock on the door, and Om Nom appears in a box, etc. How is this made? Is there any way I can embed videos in my game like that, because making a video like that, by using CCSprites and CCAnimation would consume a lot of memory.
</p></description>
		</item>
		<item>
			<title>Blue Ether on "CCUIViewWrapper - wrapper for manipulating UIViews using Cocos2D"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/6889#post-40440</link>
			<pubDate>Sun, 06 Jun 2010 16:24:08 +0000</pubDate>
			<dc:creator>Blue Ether</dc:creator>
			<guid isPermaLink="false">40440@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I wanted to share a class I've written I'm calling CCUIWrapper, which acts as a way of manipulating UIViews via Cocos2D methods.  It's not the most momumental class ever written and most of what it does is simple but a few of the pieces took a bit of tinkering and head scratching to put together.  I'm sharing this because I think many people might find it very useful, and I'm inclined to believe that it should even be included as part of Cocos2D.  UIViews can do many things that Cocos cannot, and the differences between the two systems make them very confusing to merge together.  Hopefully this class simplifies the process for people.</p>
<p>Applications:<br />
I originally started developing this to be used for fading and moving AdMob ads.  I have continued tinkering with it for use with an iPad app that has a few UITextFields and where rotations are needed to allow for orientation changes.</p>
<p>First, how to initialize a UIView with the wrapper:<br />
<pre><code>UIView *myView	= [[[UIView alloc] init] autorelease];
CCUIViewWrapper *wrapper = [CCUIViewWrapper wrapperForUIView:myView];
wrapper.contentSize = CGSizeMake(320, 160);
wrapper.position = ccp(64,64);
[self addChild:wrapper];

// cleanup
[self removeChild:wrapper cleanup:true];
wrapper = nil;</code></pre>
<p>The wrapper puts a retain on its UIView, so you can autorelease it as you create it.  In practice though, you probably want to maintain a seperate reference to the UIView since you don't want to have to keep casting and type checking the UIView to see if its actually the UITextField (or whatever else) that you created.</p>
<p>The view doesn't have to be initialized with a frame size (though it can be), because setting the content size of the wrapper automatically resizes the frame.  Also, adding the wrapper to another Cocos object will automatically add its associated uiView to the Cocos openGLView window.</p>
<p>Next, usage:<br />
<pre><code>[wrapper runAction:[CCRotateTo actionWithDuration:.25f angle:180]];
wrapper.position = ccp(96,128);
wrapper.opacity = 127;
[wrapper runAction:[CCScaleBy actionWithDuration:.5f scale:.5f];
wrapper.visible = false;</code></pre>
<p>After creation, you can basically treat the wrapper as if it were the UIView.  Anywhere you position the wrapper, that's where the UIView will be.  Similarly, you can modify visibility, opacity, rotation, and scale.  The UIView is automatically updated.  This includes modifications made via actions.</p>
<p>Questions / Limitations / Missing functionalities:<br />
- I've tried to make the wrapper include transforms of its parents.  However, I'm not sure if this includes scale or opacity, as I haven't tested it.  Honoring parent rotations was a bit of work to get set up, and I didn't need to worry about honoring parent scale or parent opacity for my application.<br />
- I'm not sure if rotations will work right unless the anchor point of the wrapper is at .5,.5 (though position should work fine).  I was only using center anchor points, so it didn't come up.<br />
- I'm also not sure if you add subviews to your UIView whether those will be positioned properly, though I assume they will<br />
- If you transform the wrapper's parent/grandparent/etc, the wrapper can handle that, but it needs to be told it has to recalculate the uiView's position.  You can do this by calling: [wrapper updateUIViewTransform];<br />
If, for example, you are running a CCRotateTo action on the wrapper's parent, then updateUIViewTransform will need to be called every frame during that action.  Maybe there is a better way of integrating the update method so that Cocos will automatically trigger the code?  I'm not very familiar with the very low level of how Cocos lets children know their parent has changed transformation.</p>
<p>Finally, here is the source:<br />
CCUIViewWrapper.h<br />
<pre><code>#<a href='http://www.cocos2d-iphone.org/forum/tags/import'>import</a> &#34;cocos2d.h&#34;

@interface CCUIViewWrapper : CCSprite
	{
	UIView *uiItem;
	float rotation;
	}

@property (nonatomic, retain) UIView *uiItem;

+ (id) wrapperForUIView:(UIView*)ui;
- (id) initForUIView:(UIView*)ui;

- (void) updateUIViewTransform;

@end</code></pre>
<p>CCUIViewWrapper.m<br />
<pre><code>#<a href='http://www.cocos2d-iphone.org/forum/tags/import'>import</a> &#34;CCUIViewWrapper.h&#34;

@implementation CCUIViewWrapper

@synthesize uiItem;

+ (id) wrapperForUIView:(UIView*)ui
	{
	return [[[self alloc] initForUIView:ui] autorelease];
	}

- (id) initForUIView:(UIView*)ui
	{
	if((self = [self init]))
		{
		self.uiItem = ui;
		return self;
		}
	return nil;
	}

- (void) dealloc
	{
	self.uiItem = nil;
	[super dealloc];
	}

- (void) setParent:(CCNode *)parent
	{
	if(parent == nil)
		[uiItem removeFromSuperview];
	else if(uiItem != nil)
		[[[[CCDirector sharedDirector] openGLView] window] addSubview: uiItem];
	[super setParent:parent];
	}

- (void) updateUIViewTransform
	{
	float thisAngle, pAngle;
	CGAffineTransform	transform = CGAffineTransformMakeTranslation(0, [[UIScreen mainScreen] bounds].size.height);

	for(CCNode *p = self; p != nil; p = p.parent)
		{
		thisAngle = CC_DEGREES_TO_RADIANS(p.rotation);

		if(!p.isRelativeAnchorPoint)
			transform = CGAffineTransformTranslate(transform, p.anchorPointInPixels.x, p.anchorPointInPixels.y);

		if(p.parent != nil)
			{
			pAngle = CC_DEGREES_TO_RADIANS(p.parent.rotation);

			transform = CGAffineTransformTranslate(transform,
						(p.position.x * cosf(pAngle)) + (p.position.y * sinf(pAngle)),
						(-p.position.y * cosf(pAngle)) + (p.position.x * sinf(pAngle)));
			}
		else
			transform = CGAffineTransformTranslate(transform, p.position.x, -p.position.y);

		transform = CGAffineTransformRotate(transform, thisAngle);
		transform = CGAffineTransformScale(transform, p.scaleX, p.scaleY);

		transform = CGAffineTransformTranslate(transform, -p.anchorPointInPixels.x, -p.anchorPointInPixels.y);
		}

	[uiItem setTransform:transform];
	}

- (void) setVisible:(BOOL)v
	{
	[super setVisible:v];
	[uiItem setHidden:!v];
	}

- (void) setRotation:(float)protation
	{
	[super setRotation:protation];
	[self updateUIViewTransform];
	}

- (void) setScaleX:(float)sx
	{
	[super setScaleX:sx];
	[self updateUIViewTransform];
	}

- (void) setScaleY:(float)sy
	{
	[super setScaleY:sy];
	[self updateUIViewTransform];
	}

- (void) setOpacity:(GLubyte)opacity
	{
	[uiItem setAlpha:opacity/255.0f];
	[super setOpacity:opacity];
	}

- (void) setContentSize:(CGSize)size
	{
	[super setContentSize:size];
	uiItem.frame	= CGRectMake(0, 0, self.contentSize.width, self.contentSize.height);
	uiItem.bounds	= CGRectMake(0, 0, self.contentSize.width, self.contentSize.height);
	}

- (void) setAnchorPoint:(CGPoint)pnt
	{
	[super setAnchorPoint:pnt];
	[self updateUIViewTransform];
	}

- (void) setPosition:(CGPoint)pnt
	{
	[super setPosition:pnt];
	[self updateUIViewTransform];
	}

@end</code></pre>
<p>EDIT: I should note, I developed this for 0.99.2.  I haven't tested it with 0.99.3.
</p></description>
		</item>
		<item>
			<title>CAppleton on "Animation sprites not showing"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28802#post-141914</link>
			<pubDate>Mon, 30 Jan 2012 22:53:57 +0000</pubDate>
			<dc:creator>CAppleton</dc:creator>
			<guid isPermaLink="false">141914@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hi everyone, I apologise if this sort of thread has been posted and discussed but i could not see it when i looked, I am pretty new to cocos2d and this is the first time I have done any animations on it. I have created a valid plise and png with the same file name and added them to my project, i then have the following code in my class to setup the animation of the sprite in it:</p>
<p>CCSpriteFrameCache* framecache = [CCSpriteFrameCache sharedSpriteFrameCache];</p>
<p>        CCSpriteBatchNode *spriteSheet = [CCSpriteBatchNode batchNodeWithFile:@"SnakeAnimation.png"];<br />
        [m_gameScene addChild:spriteSheet];</p>
<p>        [framecache addSpriteFramesWithFile:@"SnakeAnimation.plist"];</p>
<p>        m_sprite = [CCSprite spriteWithSpriteFrameName:@"Snake2.png"];<br />
        [spriteSheet addChild:m_sprite];</p>
<p>        NSMutableArray* animFrames = [NSMutableArray array];<br />
        for(int i = 0; i &#60; 7; i++)<br />
        {<br />
            CCSpriteFrame* frame = [[CCSpriteFrameCache sharedSpriteFrameCache] spriteFrameByName:[NSString stringWithFormat:@"Snake%d.png",i+1]];<br />
            [animFrames addObject:frame];<br />
        }</p>
<p>        CCAnimation *animation = [CCAnimation animationWithFrames:animFrames delay:0.1];</p>
<p>        [m_sprite runAction:[CCRepeatForever actionWithAction: [CCAnimate actionWithAnimation:animation] ]];</p>
<p>I have checked the frame cache etc and they are all valid and appear to add the plist etc correctly, however they can never find any of the files and my objects are created on screen without any image what so ever. I'm not sure what else i need to do to get it working so any help would be greatly appreciated!
</p></description>
		</item>
		<item>
			<title>cocos2der on "advanced cocos2d physics question"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28485#post-140199</link>
			<pubDate>Thu, 19 Jan 2012 13:31:33 +0000</pubDate>
			<dc:creator>cocos2der</dc:creator>
			<guid isPermaLink="false">140199@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I want to make a 2D game with advanced graphics and physics like Cut the Rope and Angry birds. I've been working with Cocos2D but have not been able to achieve this. All the Cocos2D tutorials and apps I've found don't really teach the advanced stuff. Could someone please help me, with advice, tutorials or anything that will help me develop high quality Cocos2D games.
</p></description>
		</item>
		<item>
			<title>dgtheman on "Typing action for CCLabelTTF?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28777#post-141797</link>
			<pubDate>Mon, 30 Jan 2012 01:05:20 +0000</pubDate>
			<dc:creator>dgtheman</dc:creator>
			<guid isPermaLink="false">141797@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Is there an action that types out a CCLabel or something of that sort? I cant use CCFadeIn because it doesnt essentially "type" the words. What I mean by this is having an action which takes the individual letters from the string in the label and makes them appear as if they are being typed. Ex:<br />
<a href="http://www.youtube.com/watch?v=rCpbc23APqg&#038;feature=related" rel="nofollow">http://www.youtube.com/watch?v=rCpbc23APqg&#038;feature=related</a></p>
<p>^Thats pretty much what i want to do with a CCLabel
</p></description>
		</item>
		<item>
			<title>invulse on "[Tool] Export timeline animations from Adobe Flash and import as Cocos2d Actions"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/6239#post-36574</link>
			<pubDate>Fri, 07 May 2010 05:41:08 +0000</pubDate>
			<dc:creator>invulse</dc:creator>
			<guid isPermaLink="false">36574@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>While working on my current project which uses a lot of cocos2d actions to create character animations (as opposed to frame by frame animations)  I found it incredibly difficult to make decent looking animations as I had to do trial and error to place movements. </p>
<p>So today I start building a tool in AIR and an interpreter in Obj-C which will allow you to take a timeline animation in Adobe Flash, export the keyframes into my tool then export a PList file for Obj-c which my interpreter will convert to Cocos2d actions.  So far everything is going well, but I still have bug testing and project saving/loading to implement. </p>
<p>Currently the tool will take the position of the object in flash and can handle changes in x,y,scaleX,scaleY and rotation for 'Classic Tweens', but not the new Motion Editor Tweens.  It also will account for basic easing from flash and convert into CCEaseIn or CCEaseOut actions.</p>
<p>I will release the tool and source as soon as bug test some more and complete the AIR tool.</p>
<p>Here is a quick video demo I made showing how to export from flash to my tool then to Cocos2d (sorry about the big green watermark, but I havent payed for IShowU yet):</p>
<p><a href="http://www.youtube.com/watch?v=8ZyqGrdkTtM" rel="nofollow">http://www.youtube.com/watch?v=8ZyqGrdkTtM</a>
</p></description>
		</item>
		<item>
			<title>DotKing on "[Game] Witch On Broom another game use cocos2d and box2D"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28494#post-140257</link>
			<pubDate>Thu, 19 Jan 2012 19:55:33 +0000</pubDate>
			<dc:creator>DotKing</dc:creator>
			<guid isPermaLink="false">140257@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>After 4 months hard working Witch On Broom now released on App Store.<br />
I used COCOS2d  to developed this game and get lots of help from the posting in this site.<br />
Here some<br />
promote code:<br />
L3YP6AXT4TMN<br />
KTFTPHANWYYJ<br />
7XAJNNWXLFR4<br />
PK66WRA7TP3F<br />
6RNTF4HEHTRE<br />
P69YJXJWEYNT<br />
RTNRATEF43XX<br />
every one are welcome to download this game, It will be very good if you can rate this game.<br />
Thanks every one
</p></description>
		</item>
		<item>
			<title>tron_thomas on "Exporting animation from Maya to pod format on Macintosh"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28122#post-138316</link>
			<pubDate>Fri, 06 Jan 2012 04:16:53 +0000</pubDate>
			<dc:creator>tron_thomas</dc:creator>
			<guid isPermaLink="false">138316@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I am a Software Developer who is planning on working with an artist friend of mine to develop a game for the iPad.  We both work on the Macintosh, and he uses Maya, so I want to understand what it take to create and export an animated character that will work in Cocos3D.</p>
<p>Testing with Maya 2010, I install the PowerVR POD exporter plugin, and I was able to create a simple animated character that I exported to the pod format.</p>
<p>On the iPad simulator, I can get the character to appear in a Cocos3D application, only it does not appear to have any animation, even though, I believe I applied the appropriate settings to export the animation to the pod file.</p>
<p>Where can I find information on how someone is supposed to create animations in Maya that will export to the pod format?
</p></description>
		</item>
		<item>
			<title>Th3rapist on "Multiple Animations in one .plist"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28528#post-140473</link>
			<pubDate>Sat, 21 Jan 2012 04:04:49 +0000</pubDate>
			<dc:creator>Th3rapist</dc:creator>
			<guid isPermaLink="false">140473@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hi, I am fairly new to iPhone development and i am currently using cocos2dx.<br />
My question is about having multiple animations in one  png and plist file and how/ if this is best practices.<br />
currently I am using texturePacker for creating my png and plists and when adding single frames i was wondering if i could catagerize them as animations or if i should be making separate plists/packed png's for this.
</p></description>
		</item>
		<item>
			<title>brandon2520 on "Need help wrapping head around batchnodes"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28097#post-138121</link>
			<pubDate>Thu, 05 Jan 2012 08:08:35 +0000</pubDate>
			<dc:creator>brandon2520</dc:creator>
			<guid isPermaLink="false">138121@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>So I've read a couple of tutorials on sprite animation in cocos2d, and it's a tad different than other frameworks I am use to using.</p>
<p>The examples I saw were super basic and involved setting everything up in the default scene that gets created with a cocos2d project.</p>
<p>I'm messing around with a basic space shooter to just learn the engine before I start something real.</p>
<p>I've got my level scene, and it will be filled with ships. Many of the ships will be the same artwork, so I know that I need to take advantage of the sprite batch benefits.</p>
<p>My issue comes with architecture design. I don't want the level to know about the animation logic for the ships. I want that to stay contained to each of the ship classes.</p>
<p>My BasicShip class inherits from sprite (but perhaps it shouldn't?)</p>
<p>I'd love to be able to just say something like:<br />
BasicShip *ship = [[BasicShip alloc] init];<br />
ship.position = center of screen.<br />
[level addChild:ship];</p>
<p>After that, the ship would be loaded on the screen and be playing it's basic animation.</p>
<p>Now, correct me if I'm wrong, but I think the sprite sheet (CCSpriteBatchNode) must be added to the level scene and not the ships layer in order for all of the other ships to get the benefits of that spritebatch.</p>
<p>I'm a little stuck on how exactly this should all pan out. I figured I'd post here to get some input before my architecture gets severely out of whack.</p>
<p>Currently I have in my BasicShip's init method (which inherits from CCSprite:</p>
<pre><code>-(id) init
{
    self = [super init];
    if(self)
    {

        acceleration = 5;
        velocity = 0;
        maxVelocity = 10;

        [[CCSpriteFrameCache sharedSpriteFrameCache] addSpriteFramesWithFile:@&#34;tempShipAnim.plist&#34;];
        self.movementSpriteSheet = [CCSpriteBatchNode batchNodeWithFile:@&#34;tempShipAnim.png&#34;];
        [[self parent] addChild:movementSpriteSheet]; //obviously parent would be nil at this point, but i&#039;m putting this here to emphasize that I think it should be added to the parent

        NSMutableArray *movementFrames = [NSMutableArray array];
        for(int i = 1; i &#60; 5; i++)
        {
            [movementFrames addObject:[[CCSpriteFrameCache sharedSpriteFrameCache] spriteFrameByName:[NSString stringWithFormat:@&#34;ship%d.png&#34;, i]]];
        }

        CCAnimation *movementAnimation = [CCAnimation animationWithFrames:movementFrames delay:0.1];

        self.moveAction = [CCRepeatForever actionWithAction:[CCAnimate actionWithAnimation:movementAnimation restoreOriginalFrame:NO]];
        [self runAction:moveAction];
    }
    return self;
}</code></pre>
<p>The code above is obviously not working. Just posting here for some input on how I should be structuring this code.</p>
<p>Thanks!
</p></description>
		</item>
		<item>
			<title>NOG on "Animated tiles"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/18690#post-104867</link>
			<pubDate>Thu, 14 Jul 2011 15:34:49 +0000</pubDate>
			<dc:creator>NOG</dc:creator>
			<guid isPermaLink="false">104867@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I've been looking around for quite a while, and I have not been able to find any good information on how to animate tiles from a tmx tile map.  Anyone know how? Code?
</p></description>
		</item>
		<item>
			<title>nexen on "why is a NIGHTMARE to animate a tile map?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28331#post-139415</link>
			<pubDate>Fri, 13 Jan 2012 19:15:44 +0000</pubDate>
			<dc:creator>nexen</dc:creator>
			<guid isPermaLink="false">139415@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I really don't get why the tile map system suck so much!... who are going to make a game using a tilemap completely static?, there is NO friendly ways to animate a tile (by animations), I mean there is no really ways at all.... nothing works...</p>
<p>and please forget to mention changing the gid because that is so ugly and not functional.... if you are in the developing process your tilemap could change, if you add just one frame to the spritesheet then ALL the gids move one position.... that is sh*&#38;%%#!</p>
<p>I was trying to figure out here in the forums, but nothing works... many people say you have to put your (animation frames) in the same texture you use in the tile layer, but that does not work. other post say to use:</p>
<p> [frameCache addSpriteFramesWithFile:@"tiles.plist" texture:[levelMap layerNamed:@"tiles"].texture];</p>
<p>but that does not work.... I always get:</p>
<p>NSAssert( ! usesBatchNode_, @"CCSprite: setTexture doesn't work when the sprite is rendered using a CCSpriteBatchNode");</p>
<p>when the animations is triggered...</p>
<p>for the love of god there is some way to animate a tile WITHOUT having to create separate CCSprites ?, because then we are using tilemaps just for references (locations, values, properties)... this is the purpose for tile maps?...</p>
<p>--------------------------------------------------<br />
All that said, I have this scenario...</p>
<p>I have this files:  tiles.plist, tiles.png, map.tmx</p>
<p>map.tmx has one layer called tiles<br />
map.tmx has one tileset using tiles.png<br />
tiles.png has all the frames for animate one tile, (example: a character walking cycle)</p>
<p>using all this stuff I write in code something like this:</p>
<p>    [frameCache addSpriteFramesWithFile:@"tiles.plist" texture:[TileMap layerNamed:@"tiles"].texture];</p>
<p>    CCAnimation *walk = [CCAnimation animationWithFrames:nil delay:0.08f];<br />
    [walk addFrame:[frameCache spriteFrameByName:@"walk01.png"]];<br />
    [walk addFrame:[frameCache spriteFrameByName:@"walk02.png"]];<br />
    [walk addFrame:[frameCache spriteFrameByName:@"walk03.png"]];</p>
<p>     [animCache walk name:@"anim-walk"];</p>
<p>    CCSprite *walk = [tile_layer tileAt:ccp(x,y)];</p>
<p>     CCAnimation *animationLoop= [[CCAnimationCache sharedAnimationCache] animationByName:@"anim-walk"];</p>
<p>      id anim_loop = [CCAnimate actionWithAnimation: animationLoop restoreOriginalFrame:NO];</p>
<p>      CCRepeatForever *repeat = [CCRepeatForever actionWithAction: anim_loop];</p>
<p>      [walk runAction: repeat];</p>
<p>If I use this the app crash here:<br />
NSAssert( ! usesBatchNode_, @"CCSprite: setTexture doesn't work when the sprite is rendered using a CCSpriteBatchNode");</p>
<p>What I have to do to make this work? thank you very much for your support
</p></description>
		</item>
		<item>
			<title>Fanoaky on "How do I flip a card over in a fluid animation?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/15771#post-89162</link>
			<pubDate>Wed, 20 Apr 2011 17:39:17 +0000</pubDate>
			<dc:creator>Fanoaky</dc:creator>
			<guid isPermaLink="false">89162@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I'm trying to figure out an easy way to have a card flip over in a fluid animation without using several animation frames. I tried the fipx property but this is an instantAction and I want a fluid animation for the flip.</p>
<p>Any ideas?</p>
<p>Thanks
</p></description>
		</item>
		<item>
			<title>whahahah on "annoying EXC_BAD_ACCESS problem with scheduler"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/21580#post-119889</link>
			<pubDate>Thu, 06 Oct 2011 15:16:33 +0000</pubDate>
			<dc:creator>whahahah</dc:creator>
			<guid isPermaLink="false">119889@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I got pretty frustrated about this error,<br />
I have no idea what's wrong.<br />
Here, I am creating a simple whack-a-mole game.</p>
<p>in my init method i called this method :</p>
<pre><code>[self schedule:@selector(popRandomMole:) interval:1.0];</code></pre>
<p>This following method seems to be causing problems:</p>
<pre><code>-(void)popRandomMole: (ccTime *) dt
{
    int holeNumber;

    holeNumber = arc4random() % 4;

    [[holes objectAtIndex:holeNumber] runAnimation];

}</code></pre>
<p>it would not work. It'll get me a EXC_BAD_ACCESS signal pointing to a method in CCScheduler.m:</p>
<pre><code>-(void) update: (ccTime) dt
{
	if( elapsed == - 1)
		elapsed = 0;
	else
		elapsed += dt;
	if( elapsed &#62;= interval ) {
		impMethod(target, selector, elapsed);   //EXC_BAD_ACCESS signal here
		elapsed = 0;
	}
}</code></pre>
<p>however, there's no error if i removed this line from the popRandomMole :</p>
<pre><code>[[holes objectAtIndex:holeNumber] runAnimation];</code></pre>
<p>Okay... so what did i do wrong?
</p></description>
		</item>
		<item>
			<title>house203 on "avatar animation system with cocos3d"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/26444#post-134949</link>
			<pubDate>Tue, 20 Dec 2011 09:23:47 +0000</pubDate>
			<dc:creator>house203</dc:creator>
			<guid isPermaLink="false">134949@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hi. </p>
<p>Is it possible to create an avatar system with the latest cocos3d(since bone animation is supported now)?  That is,  we can change not only the different body part (such as upper body and lower body),  but also the action of the avatar(such as jump and walk). Should we bind all actions into one animation? </p>
<p>Thanks very much!
</p></description>
		</item>
		<item>
			<title>plc on "The animation of each part of the node"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/27759#post-136399</link>
			<pubDate>Wed, 21 Dec 2011 05:43:39 +0000</pubDate>
			<dc:creator>plc</dc:creator>
			<guid isPermaLink="false">136399@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hello,</p>
<p>I am new to both blender and cocos2d/cocos3d. My situation is as follows:  suppose I create a human character with armature which have arm, leg and so on in blender 3d editor, and later on this will be converted to pod file as one node in cocos3d world. Here are my questions about the animation:</p>
<p>1.) If no any animation has been set up in blender,once the pod file is loaded into cocos3d, I want each part such as hand, leg, head independently animated while touched. Is this possible to let each part have its own animation instead of whole node?</p>
<p>2.) if each part has the animation already set up in blender, after converted to pod and loaded into coco3d world, suppose in the beginning all these animation were disabled, but I want each part to be able to animate once touched, is this possible? If yes, could you please let me know how to do it?</p>
<p>Any suggestions I really appreciate.
</p></description>
		</item>
		<item>
			<title>CS on "Proper way of handling movement of enemies."</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/27832#post-136724</link>
			<pubDate>Fri, 23 Dec 2011 17:29:06 +0000</pubDate>
			<dc:creator>CS</dc:creator>
			<guid isPermaLink="false">136724@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I have a question regarding the code design of some npc's i am adding to a game i am working on.<br />
The NPC is subclassed from CCNode, and in there i have some variables together with the the move methods:<br />
_body is of class, CCSprite.</p>
<pre><code>-(void) movementLogic:(ccTime) dt
{
    CGPoint moveTo = CGPointMake(CCRANDOM_0_1() * 200 - 100, 0);
    [self logicRun:2.0f position:moveTo];
}
-(void) logicRun:(float) duration position:(CGPoint) moveTo
{
    CCMoveBy *move = [CCMoveBy actionWithDuration:duration position:moveTo];
    [_body runAction:move];
}</code></pre>
<p>In a scene i am testing it on i add a few based on spawn locations from Tiled:<br />
<pre><code>- (void) addNPCAtX:(int)x Y:(int) y Type:(int)type
{
    NPC *npcClass = [NPC npcWithParentNode:self];
    npcClass.position = ccp(x,y);
}</code></pre>
<p>They do appear, but they don't move. I also have a feeling that i am not in control of them, in case of later use where i need to do some collision detection.<br />
Could someone point out, what I might be doing wrong? Thanks for the time guys.
</p></description>
		</item>
		<item>
			<title>mongoose54 on "Animating vertices with a custom function."</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/25768#post-134198</link>
			<pubDate>Mon, 19 Dec 2011 15:23:33 +0000</pubDate>
			<dc:creator>mongoose54</dc:creator>
			<guid isPermaLink="false">134198@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hi,</p>
<p>I am new to Cocos3D and I want to ask you if it Is possible to animate the vertices of a body through a custom function? Basically I have a plane (x by y dimension) and I want to deform it using a specific formula: z = f(x,y) . Does Cocos3d support this? Thanks in advance!
</p></description>
		</item>
		<item>
			<title>TomJudd on "[GAME] Ready Steady Bang"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/18308#post-102706</link>
			<pubDate>Mon, 04 Jul 2011 11:01:50 +0000</pubDate>
			<dc:creator>TomJudd</dc:creator>
			<guid isPermaLink="false">102706@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Introduction:<br />
Ready Steady Bang is cowboy dueling game - coming to iphone this Autumn</p>
<p>Why developers will find my game interesting:<br />
Ready Steady Bang shows how a simple concept can catch the imagination of the gamer. Simple interaction and beautiful animation make rsb what is.</p>
<p>Why gamers will find my game interesting:<br />
Ready Steady Bang focuses on super slick character animation. The simple gameplay means that anyone can pick up and play. You are going to fall in love with the little guy. </p>
<p>Screen shots coming soon:</p>
<p>You can follow the progress of Ready Steady Bang here<br />
<a href="http://rsbang.com" rel="nofollow">http://rsbang.com</a></p>
<p>Here is a teaser video<br />
<a href="http://vimeo.com/25816491" rel="nofollow">http://vimeo.com/25816491</a></p>
<p>[END TEMPLATE]
</p></description>
		</item>
		<item>
			<title>jordi_tda on "TDAnimEngine: Maya to Cocos2D"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/18186#post-101990</link>
			<pubDate>Thu, 30 Jun 2011 17:35:11 +0000</pubDate>
			<dc:creator>jordi_tda</dc:creator>
			<guid isPermaLink="false">101990@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hi,</p>
<p>I wanted to share with you a couple of scripts and a library we are developing with you.</p>
<p><a href="https://github.com/TheDamArmada/TDAnimEngine">https://github.com/TheDamArmada/TDAnimEngine</a></p>
<p>The idea is to create characters and animate them (using only rotations, ala Direct Kinematic) in Maya and recreate them in Cocos2D.<br />
It's not sprite based. It's designed to help the creation of "cut-out" characters made out of pieces.</p>
<p>We also created a tutorial for the first part: bringing Maya characters into Cocos2D.</p>
<p><a href="http://fbgpc.thedamarmada.com/2011/06/maya-to-cocos2d/"><a href="http://fbgpc.thedamarmada.com/2011/06/maya-to-cocos2d/" rel="nofollow">http://fbgpc.thedamarmada.com/2011/06/maya-to-cocos2d/</a><br />
</a><br />
It's a work in progress. We would love to make the Maya part easier but we are not experts on MEL. But as we learn more and we improve it we will keep updating it.</p>
<p>And please, suggestions, comments and questions are always welcome.</p>
<p>Anyway, hope it helps someone. </p>
<p>TDA
</p></description>
		</item>
		<item>
			<title>Objective Zero on "Move CCSprite with other CCSprite when touched?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/25523#post-132828</link>
			<pubDate>Mon, 12 Dec 2011 05:40:03 +0000</pubDate>
			<dc:creator>Objective Zero</dc:creator>
			<guid isPermaLink="false">132828@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hey,</p>
<p>So lets say I have Sprite A and Sprite B. Sprite B has a animation that makes it move down the screen. Then Sprite A is controlled by the UIAccelerometer and is only controller on the X Axis. But how would I do the following, when Sprite A touches SpriteB it will move Sprite A along with Sprite B down the screen?</p>
<p>This is also similar to the app Fall Down, as the platforms move down the screen, so does the character. How would I be able to accomplish this?</p>
<p>Thanks!
</p></description>
		</item>
		<item>
			<title>slimrick03 on "Animating based on accelerometer help anyone?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/25496#post-132685</link>
			<pubDate>Sun, 11 Dec 2011 04:53:29 +0000</pubDate>
			<dc:creator>slimrick03</dc:creator>
			<guid isPermaLink="false">132685@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hey I would like to know how can I play an animation of my bird whenever I tilt my device up or down. I have a bird playing a constant animation of it flapping its wings so it looks like the bird is flying, that bird is moved by the accelerometer I would like to know how can I make the bird play another animation of it swaying to the position the device was moved to for example if the player moves the bird to the left I would like for it to play in animation of it swaying to the left and vise versa.<br />
If any one of you can help me I would be very happy :)<br />
Here is the code:</p>
<pre><code>// Accelerometer
-(void)accelerometer:(UIAccelerometer *)accelerometer didAccelerate:(UIAcceleration *)acceleration {
    birdSpeedY = 9.0 + acceleration.x*15;
    birdSpeedX = -acceleration.y*20;
}

// Updating bird based on accelerometer
-(void)updateBird {
    float maxY = winSize.height - bird.contentSize.height/2;
    float minY = bird.contentSize.height/2;
    float newY = bird.position.y + birdSpeedY;
    newY = MIN(MAX(newY, minY), maxY);

    float maxX = winSize.width - bird.contentSize.width/2;
    float minX = bird.contentSize.width/2;
    float newX = bird.position.x + birdSpeedX;
    newX = MIN(MAX(newX, minX), maxX);

    bird.position = ccp(newX, newY);
}

// Making background scroll automatically
-(void)update:(ccTime)dt {
    [self updateBird];

    CGPoint backgroundScrollVel = ccp(-100, 0);
    parallaxNode.position = ccpAdd(parallaxNode.position, ccpMult(backgroundScrollVel, dt));

}

-(id)init {
    self = [super init];
    if (self != nil) {
       winSize = [CCDirector sharedDirector].winSize;

        CCSpriteFrameCache *cache=[CCSpriteFrameCache sharedSpriteFrameCache];
        [cache addSpriteFramesWithFile:@&#34;birdAtlas.plist&#34;];

        NSMutableArray *framesArray=[NSMutableArray array];
        for (int i=1; i&#60;10; i++) {
            NSString *frameName=[NSString stringWithFormat:@&#34;bird%d.png&#34;, i];
            id frameObject=[cache spriteFrameByName:frameName];
            [framesArray addObject:frameObject];
        }
        // animation object
        id animObject=[CCAnimation animationWithFrames:framesArray delay:0.1];

        // animation action
        id animAction=[CCAnimate actionWithAnimation:animObject restoreOriginalFrame:NO];
        animAction=[CCRepeatForever actionWithAction:animAction];

        bird=[CCSprite spriteWithSpriteFrameName:@&#34;bird1.png&#34;];
        bird.position=ccp(60,160);

        CCSpriteBatchNode *batchNode=[CCSpriteBatchNode batchNodeWithFile:@&#34;birdAtlas.png&#34;];
        [self addChild:batchNode z:100];
        [batchNode addChild:bird];

        [bird runAction:animAction];

        self.isAccelerometerEnabled = YES;
        [self scheduleUpdate]; 

        [self addScrollingBackgroundWithTileMapInsideParallax];
    }
    return self;
}

- (void) dealloc
{
	[super dealloc];
}

@end</code></pre></description>
		</item>
		<item>
			<title>galenzo17 on "Performance on Ipad, load sprite´s (StoryBook)"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/25377#post-132051</link>
			<pubDate>Wed, 07 Dec 2011 12:45:08 +0000</pubDate>
			<dc:creator>galenzo17</dc:creator>
			<guid isPermaLink="false">132051@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hi!</p>
<p>My code:</p>
<p>/////////////////////////////////  nandu.h    /////////////////////////////////////////</p>
<p>@interface nandu : CCLayer<br />
{<br />
	CCSprite *fondo;<br />
	//CCParticleRain *lluvialenguad;<br />
}</p>
<p>+(CCScene *) scene;</p>
<p>@end</p>
<p>///////////////////////////////********************/////////////////////////<br />
///////////////////////////////********************/////////////////////////<br />
///////////////////////////////********************/////////////////////////<br />
///////////////////////////////********************/////////////////////////<br />
///////////////////////////////********************/////////////////////////</p>
<p>/////////////////////////////////  nandu.m    /////////////////////////////////////////</p>
<p>#<a href='http://www.cocos2d-iphone.org/forum/tags/import'>import</a> "nandu.h"</p>
<p>@implementation nandu</p>
<p>+(CCScene *) scene<br />
{<br />
	// 'scene' is an autorelease object.<br />
	CCScene *scene = [CCScene node];</p>
<p>	// 'layer' is an autorelease object.<br />
	nandu *layer = [nandu node];</p>
<p>	// add layer as a child to scene<br />
	[scene addChild: layer];</p>
<p>	// return the scene<br />
	return scene;<br />
}</p>
<p>-(void)starButtonTapped{</p>
<p>	[[bookmanager sharedbookmanager] runSceneWithID:kcuruscene];</p>
<p>}</p>
<p>// on "init" you need to initialize your instance<br />
-(id) init<br />
{<br />
	// always call "super" init<br />
	// Apple recommends to re-assign "self" with the "super" return value<br />
	if( (self=[super init])) {</p>
<p>                isTouchEnabled_=YES;</p>
<p>		[[CCSpriteFrameCache sharedSpriteFrameCache] addSpriteFramesWithFile:@"curunandu.plist"];</p>
<p>		fondo =[CCSprite spriteWithFile:@"fondonandu.png"];<br />
		fondo.position=ccp(384,514);</p>
<p>		[self addChild:fondo z:-2];</p>
<p>		CCSprite *nandiu=[CCSprite spriteWithSpriteFrameName:@"nandusinfondo.png"];<br />
		//lenguado.anchorPoint=ccp(0,0);<br />
		nandiu.position= ccp(391, 637);<br />
		nandiu.tag=100;<br />
		[self addChild:nandiu];</p>
<p>		CCMenuItem *adelante = [CCMenuItemImage<br />
								itemFromNormalImage:@"1.png" selectedImage:@"1.png"<br />
								target:self selector:@selector(starButtonTapped)];<br />
		adelante.position = ccp(640, 60);</p>
<p>		CCMenuItem *atras = [CCMenuItemImage<br />
							 itemFromNormalImage:@"3.png" selectedImage:@"3.png"<br />
							 target:self selector:@selector(starButtonTapped)];<br />
		atras.position = ccp(130, 60);</p>
<p>		CCMenuItem *indice = [CCMenuItemImage<br />
							  itemFromNormalImage:@"2.png" selectedImage:@"2.png"<br />
							  target:self selector:@selector(starButtonTapped)];<br />
		indice.position = ccp(388, 100);</p>
<p>		CCMenuItem *ficha = [CCMenuItemImage<br />
							 itemFromNormalImage:@"botonfichatransparente.png" selectedImage:@"botonfichatransparente.png"<br />
							 target:self selector:@selector(starButtonTapped)];<br />
		ficha.position = ccp(189, 254);</p>
<p>		CCMenuItem *texto = [CCMenuItemImage<br />
							 itemFromNormalImage:@"botontransparentetexto.png" selectedImage:@"botontransparentetexto.png"<br />
							 target:self selector:@selector(starButtonTapped)];<br />
		texto.position = ccp(583, 305);</p>
<p>		CCMenu *starMenu = [CCMenu menuWithItems:adelante,atras,indice,ficha,texto, nil];<br />
		starMenu.position = CGPointZero;<br />
		[self addChild:starMenu];<br />
	}<br />
	return self;<br />
}</p>
<p>////Is this OK? mmmmm, I think maybe not, but work///////</p>
<p>-(void) ccTouchesBegan :(NSSet *) touches withEvent :(UIEvent *)event<br />
{<br />
	UITouch *touch =[touches anyObject];<br />
	CGPoint location= [touch locationInView:[touch view]];<br />
	location=[[CCDirector sharedDirector]convertToGL:location];</p>
<p>	CCSprite *nandusinfondo=(CCSprite *)[self getChildByTag:100];</p>
<p>	id effect = [CCWaves actionWithWaves:10 amplitude:10 horizontal:YES vertical:YES grid:ccg(10, 10) duration:3];<br />
	[nandusinfondo runAction:effect];</p>
<p>}</p>
<p>- (void) dealloc<br />
{<br />
	[[CCSpriteFrameCache sharedSpriteFrameCache] removeUnusedSpriteFrames];</p>
<p>	// don't forget to call "super dealloc"<br />
	[super dealloc];<br />
}</p>
<p>@end</p>
<p>///////////////////////////////********************/////////////////////////<br />
///////////////////////////////********************/////////////////////////<br />
///////////////////////////////********************/////////////////////////<br />
///////////////////////////////********************/////////////////////////<br />
///////////////////////////////********************/////////////////////////<br />
My  code works at 15 fps</p>
<p>And I have a BookManager and constant</p>
<p>My questions:</p>
<p>-How i can change my code for better performance?  Any Ideas? :)<br />
-I have 65 page to do; Is this the best way?<br />
-15 fps on device is ok? or crash all the time?<br />
-is this  the best way for sprites load?<br />
-All my art work is in .png; I have to change to .pvr?</p>
<p>i'm new on cocos2d and I almost finished my work and i need from the experience voice</p>
<p>and a study a lot before ask</p>
<p>sorry for my english i´m from Argentina like Riq!</p>
<p>best regards
</p></description>
		</item>
		<item>
			<title>Jeff on "[OT but not really] classic Terry Gilliam cut-animation how-to"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/25357#post-131937</link>
			<pubDate>Tue, 06 Dec 2011 17:14:27 +0000</pubDate>
			<dc:creator>Jeff</dc:creator>
			<guid isPermaLink="false">131937@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>We all need inspiration now and again and I think all cocos2D developers will enjoy and appreciate this classic video.<br />
(watch all 16 mins if you can, it is not all just animation demos but Gilliam talks about his techniques too)</p>
<p><a href="http://www.youtube.com/watch?feature=player_embedded&#038;v=xs7WaL44_Iw" rel="nofollow">http://www.youtube.com/watch?feature=player_embedded&#038;v=xs7WaL44_Iw</a></p>
<p>Not only is it interesting footage of early Terry Gilliam, but hopefully you can see the direct correlation between old-time analog cut-out animation and our digital sprite animation work in cocos2d.<br />
Some of the tips even have direct relevance today when we work in cocos2d.</p>
<p>(Yes, I'd also like to secretly see some Monty Python style-esque cocos2d animation apps out there :P)</p>
<p>Enjoy,<br />
Jeff
</p></description>
		</item>

	</channel>
</rss>

