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

		<item>
			<title>JohnTaylor on "How does one create a transparent director view for the Mac?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/14631#post-125931</link>
			<pubDate>Mon, 14 Nov 2011 07:20:43 +0000</pubDate>
			<dc:creator>JohnTaylor</dc:creator>
			<guid isPermaLink="false">125931@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Thanks alberteddu. That code does help as I now have a transparent window, glview and CCLayer (by using CCLayerColor). </p>
<p>The only thing stopping me from having a completely transparent application is CCScene as this still has a black background :(</p>
<p>Does anyone know anyway of making CCScene transparent?
</p></description>
		</item>
		<item>
			<title>SoundBlaster on "&#039;ReplaceScene&#039; and memory management"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/22065#post-122634</link>
			<pubDate>Sun, 23 Oct 2011 13:22:22 +0000</pubDate>
			<dc:creator>SoundBlaster</dc:creator>
			<guid isPermaLink="false">122634@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Oh, I found - did you mean [[CCSpriteFrameCache sharedSpriteFrameCache] removeUnusedSpriteFrames] ?<br />
It looks like a key for my question.<br />
Thanks! Thanks a lot!!!
</p></description>
		</item>
		<item>
			<title>SoundBlaster on "&#039;ReplaceScene&#039; and memory management"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/22065#post-122629</link>
			<pubDate>Sun, 23 Oct 2011 12:37:45 +0000</pubDate>
			<dc:creator>SoundBlaster</dc:creator>
			<guid isPermaLink="false">122629@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>What does it mean "frame cache"?<br />
Does it mean "use [self removeAllChildrenWithCleanup:YES]; in method 'onExit' on the every page"?
</p></description>
		</item>
		<item>
			<title>Tone on "&#039;ReplaceScene&#039; and memory management"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/22065#post-122628</link>
			<pubDate>Sun, 23 Oct 2011 12:28:34 +0000</pubDate>
			<dc:creator>Tone</dc:creator>
			<guid isPermaLink="false">122628@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Have you tried removing the images from the frame cache and then cleaning the texture cache? I had to do this yesterday for a project I am working on. I have a large intro scene that was sticking around and causing me memory issues later.
</p></description>
		</item>
		<item>
			<title>SoundBlaster on "&#039;ReplaceScene&#039; and memory management"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/22065#post-122627</link>
			<pubDate>Sun, 23 Oct 2011 12:21:33 +0000</pubDate>
			<dc:creator>SoundBlaster</dc:creator>
			<guid isPermaLink="false">122627@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I can ask a question for another for another way: Why are volumes of allocated memory different, when I go to the page directly or from previous page?<br />
If I go to the page from menu - it takes 16 MB for all app, if I go to this page from previous - it takes more memory.</p>
<p>I use 'Activity Monitor' in Instruments. I clean texture cache and use [[CCDirector sharedDirector] purgeCachedData] when go to the page.
</p></description>
		</item>
		<item>
			<title>SoundBlaster on "&#039;ReplaceScene&#039; and memory management"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/22065#post-122615</link>
			<pubDate>Sun, 23 Oct 2011 09:31:14 +0000</pubDate>
			<dc:creator>SoundBlaster</dc:creator>
			<guid isPermaLink="false">122615@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hello!<br />
I create the interactive book for iPad.<br />
To turn the pages I use:<br />
<code>[[CCDirector sharedDirector] replaceScene:[pageClass scene]];</code><br />
I don't have any leaks, but I have notice the memory problem.<br />
For example, in my test project  I have 3 pages: first page has 1 picture (1024*768), scene of second picture if free of any child, and third page is also free.<br />
When CCDirector places first scene, allocated memory is around 11 MB.<br />
When first scene is replaced by second scene, there is also 11MB.<br />
And when second scene is replaced by third scene memory go to 8 MB, that is normal for my page without child.<br />
All methods like <code>dealloc</code> <code>onEnter</code> <code>onExit</code> are called properly.</p>
<p>In my real project every page needs around 20-30 MB of memory (I use big atlases). Simultaneous storage of 3 pages in memory calls memory warnings and causes crashing my app, because my iPad 1 doesn't have enough free memory.</p>
<p>Is it bug of Cocos?<br />
May be I do somethings wrong? Where I can read about runloop of cocos2d scene?
</p></description>
		</item>
		<item>
			<title>alberteddu on "How does one create a transparent director view for the Mac?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/14631#post-112981</link>
			<pubDate>Sat, 27 Aug 2011 13:14:40 +0000</pubDate>
			<dc:creator>alberteddu</dc:creator>
			<guid isPermaLink="false">112981@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>There is a way.</p>
<pre><code>[[glView_ opaqueAncestor] setAlphaValue:0];
glClearColor(0.0f, 0.0f, 0.0f, 0.0f);</code></pre>
<p>Hope this helps.
</p></description>
		</item>
		<item>
			<title>Normal Force on "Director Types?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/7280#post-106521</link>
			<pubDate>Sat, 23 Jul 2011 00:16:51 +0000</pubDate>
			<dc:creator>Normal Force</dc:creator>
			<guid isPermaLink="false">106521@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I would be interested, as well, in knowing where the GCD was applied to obtain this ultimate solution.
</p></description>
		</item>
		<item>
			<title>me4502 on "Its possible to save ENTIRE Director State (actions, sprites on screen, etc)?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/8191#post-101705</link>
			<pubDate>Wed, 29 Jun 2011 13:01:38 +0000</pubDate>
			<dc:creator>me4502</dc:creator>
			<guid isPermaLink="false">101705@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>@riq</p>
<p>Has any progress on that been made?
</p></description>
		</item>
		<item>
			<title>Ozden79 on "Reset Director time?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/16627#post-93734</link>
			<pubDate>Mon, 16 May 2011 18:16:57 +0000</pubDate>
			<dc:creator>Ozden79</dc:creator>
			<guid isPermaLink="false">93734@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Thanks, that did solve it.</p>
<p>I think it's the right approach as I'm loading/creating things on the same thread as the main one. Although not checked, I think Director uses this same approach in the scene initialization process as well. I say so as I use it this way in my XNA port of Cocos2d ;).
</p></description>
		</item>
		<item>
			<title>liquidfire on "Reset Director time?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/16627#post-93722</link>
			<pubDate>Mon, 16 May 2011 17:36:10 +0000</pubDate>
			<dc:creator>liquidfire</dc:creator>
			<guid isPermaLink="false">93722@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p><code>[[CCDirector sharedDirector] setNextDeltaTimeZero:YES];</code> MIGHT be what you're looking for, but to be honest I'm not completely sure.</p>
<p>Also, i'm not sure if this would help or work depending on how your visuals are set up, but could you just start the actions after you load all of your assets?
</p></description>
		</item>
		<item>
			<title>Ozden79 on "Reset Director time?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/16627#post-93721</link>
			<pubDate>Mon, 16 May 2011 17:30:04 +0000</pubDate>
			<dc:creator>Ozden79</dc:creator>
			<guid isPermaLink="false">93721@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hello There,</p>
<p>During my gameplay, when I switch a level for example, I'm loading some assets or creating some sprites. This causes a delay in game time. This is not a problem but more importantly, the actions I start during that process, seems to skip that delay in time so some of my animations seems to work like from the middle, like "Get Ready" logo moving into the screen. I think to solve this problem, I need to reset the game time so the actions can start from the beginning.</p>
<p>I could do this in other systems, such as "ResetElapsedTime" on XNA and would like to know whether we have the same feature in Cocos2d as well?</p>
<p>Thanks in advance...</p>
<p>Özden
</p></description>
		</item>
		<item>
			<title>cacao on "Director Types?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/7280#post-93420</link>
			<pubDate>Sat, 14 May 2011 19:04:35 +0000</pubDate>
			<dc:creator>cacao</dc:creator>
			<guid isPermaLink="false">93420@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>@<a href='http://www.cocos2d-iphone.org/forum/profile/45245'>rsanchezsaez</a> where do  you apply this solution? CCDirector.m?
</p></description>
		</item>
		<item>
			<title>rsanchezsaez on "Director Types?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/7280#post-93400</link>
			<pubDate>Sat, 14 May 2011 17:06:03 +0000</pubDate>
			<dc:creator>rsanchezsaez</dc:creator>
			<guid isPermaLink="false">93400@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I found the ultimate solution in this question:<br />
- <a href="http://stackoverflow.com/questions/5944050/cadisplaylink-opengl-rendering-breaks-uiscrollview-behaviour" rel="nofollow">http://stackoverflow.com/questions/5944050/cadisplaylink-opengl-rendering-breaks-uiscrollview-behaviour</a>
</p></description>
		</item>
		<item>
			<title>rsanchezsaez on "Director Types?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/7280#post-93390</link>
			<pubDate>Sat, 14 May 2011 15:59:21 +0000</pubDate>
			<dc:creator>rsanchezsaez</dc:creator>
			<guid isPermaLink="false">93390@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I tried this solution, as I'm trying to use CCDisplayLinkDirector together with an overlaid UIScrollView, but using</p>
<p>[displayLink addToRunLoop:[NSRunLoop currentRunLoop] forMode:NSRunLoopCommonModes];</p>
<p>in CCDisplayLinkDirector partially breaks UIScrollView behaviour (very fast burst scrolling doesn't get any inertia).</p>
<p>robodude666: Are you experiencing this issue?
</p></description>
		</item>
		<item>
			<title>Martin on "Its possible to save ENTIRE Director State (actions, sprites on screen, etc)?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/8191#post-93177</link>
			<pubDate>Fri, 13 May 2011 15:00:20 +0000</pubDate>
			<dc:creator>Martin</dc:creator>
			<guid isPermaLink="false">93177@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>@<a href='http://www.cocos2d-iphone.org/forum/profile/34044'>wololo</a>: check out the thread I started here: <a href="http://www.cocos2d-iphone.org/forum/topic/15412" rel="nofollow">http://www.cocos2d-iphone.org/forum/topic/15412</a><br />
There is some info in it about saving gamestate etc..
</p></description>
		</item>
		<item>
			<title>riq on "Its possible to save ENTIRE Director State (actions, sprites on screen, etc)?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/8191#post-93078</link>
			<pubDate>Fri, 13 May 2011 02:45:16 +0000</pubDate>
			<dc:creator>riq</dc:creator>
			<guid isPermaLink="false">93078@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>As @<a href='http://www.cocos2d-iphone.org/forum/profile/16943'>Benihana</a> said, it is in the roadmap. Hopefully it will be included in 1.1. or 1.2
</p></description>
		</item>
		<item>
			<title>wololo on "Its possible to save ENTIRE Director State (actions, sprites on screen, etc)?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/8191#post-93077</link>
			<pubDate>Fri, 13 May 2011 02:44:25 +0000</pubDate>
			<dc:creator>wololo</dc:creator>
			<guid isPermaLink="false">93077@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Aha! Thanks--Should've looked more closer at that I guess. Just wanted to know if there was something already built-in to take care of that.
</p></description>
		</item>
		<item>
			<title>Benihana on "Its possible to save ENTIRE Director State (actions, sprites on screen, etc)?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/8191#post-93075</link>
			<pubDate>Fri, 13 May 2011 02:38:03 +0000</pubDate>
			<dc:creator>Benihana</dc:creator>
			<guid isPermaLink="false">93075@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>You are referring to NSCoding, which will make this trivial. It was planned for 1.0, but got pushed back. I'm not sure what priority it is, so it could be anywhere from a month to a year away. I definitely wouldn't wait for it, though there isn't a really good alternative.</p>
<p><a href="http://www.cocos2d-iphone.org/wiki/doku.php/roadmap" rel="nofollow">http://www.cocos2d-iphone.org/wiki/doku.php/roadmap</a>
</p></description>
		</item>
		<item>
			<title>wololo on "Its possible to save ENTIRE Director State (actions, sprites on screen, etc)?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/8191#post-93048</link>
			<pubDate>Thu, 12 May 2011 23:57:45 +0000</pubDate>
			<dc:creator>wololo</dc:creator>
			<guid isPermaLink="false">93048@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I realize this was posted 9 months ago, but was wondering if there is any way to accomplish this? I have a bunch of enemies that are moved on the screen (they are all in a CCSpriteBatchNode), and when the application is quit, I want to save all their positions on the screen.</p>
<p>I know how to save, but I'm wondering if there's an easier way to accomplish this besides manually storing the following: The sprite, which action it's currently on, and its location on the screen.
</p></description>
		</item>
		<item>
			<title>jblyne on "Sprite flicker in transition when migrating to 0.99"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/9714#post-91646</link>
			<pubDate>Thu, 05 May 2011 03:49:20 +0000</pubDate>
			<dc:creator>jblyne</dc:creator>
			<guid isPermaLink="false">91646@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>d-range, how exactly did you fix this? Can you give me some code or more detail? Thanks so much!
</p></description>
		</item>
		<item>
			<title>d-range on "Sprite flicker in transition when migrating to 0.99"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/9714#post-90901</link>
			<pubDate>Sat, 30 Apr 2011 19:24:42 +0000</pubDate>
			<dc:creator>d-range</dc:creator>
			<guid isPermaLink="false">90901@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>If anyone is still interested in how I solved this issue for my game: it turned out the drawing artefacts where caused by sprites with fractional position coordinates. Because my sprite sheet doesn't have borders around the sprites, setting fractional position coordinates sometimes resulted in texels from adjacent sprites being rendered. The STRETCH_TEXEL_0 workaround didn't work for me, because I draw aliased, unscaled, sprites that should be aligned pixel-perfect. Enabling the texel stretch 'fix' only made things worse in my case.</p>
<p>So eventually I fixed it by simply truncating sprite coordinates.
</p></description>
		</item>
		<item>
			<title>Martin on "Strange problem with main loop / movement"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/15368#post-87305</link>
			<pubDate>Fri, 08 Apr 2011 17:46:25 +0000</pubDate>
			<dc:creator>Martin</dc:creator>
			<guid isPermaLink="false">87305@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Yes, it was the deletion code. I made some severe mistakes there. Now instead of deleting objects right away when they crash or leave the screen I only store a reference to them in an array called objectsMarkedForDeletion and the only place where I iterate over that array and remove everything in it from my main objectsArray is in the main loop before I update all my objects, check for collisions etc.. That way hopefully the array does not change when something iterates over it. I also do something similar when checking for line of sights and shooting because shooting is creating new objects is changing the array I'm iterating over. I had that right, only my deletion was faulty.<br />
Also yes, I'm reusing objects heavily, but I always call a reInit method on them that should (and it seems to) reset any value that could be wrong.
</p></description>
		</item>
		<item>
			<title>Benihana on "Strange problem with main loop / movement"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/15368#post-87295</link>
			<pubDate>Fri, 08 Apr 2011 16:43:42 +0000</pubDate>
			<dc:creator>Benihana</dc:creator>
			<guid isPermaLink="false">87295@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>No problem, I think from the looks of it, it is certainly your deletion code. Are you only allowing for one deletion per cycle? Are you reusing objects (that would have dirty values instead of what you expect). I'd also only use 2 or 3 projectiles for testing.
</p></description>
		</item>
		<item>
			<title>Martin on "Strange problem with main loop / movement"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/15368#post-87250</link>
			<pubDate>Fri, 08 Apr 2011 11:15:31 +0000</pubDate>
			<dc:creator>Martin</dc:creator>
			<guid isPermaLink="false">87250@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Thanks a lot for your reply. I tried this now. My thought was that it should not matter where the timeDeltaFactor is clipped or if it is clipped because it should always be in sync as all objects get the same delta time to respond to. I've also logged the x position of the objects so that you can see the drift.<br />
My new test setup is two scripted spawners that spawn a projectile every 0.5 seconds to the right. They should be in sync, but they are not after a while. This is how my log starts:</p>
<p>2011-04-08 12:57:12.658 cocos2d-project[94819:207] main loop update delta: 0.033317<br />
2011-04-08 12:57:12.692 cocos2d-project[94819:207] timedelta: 2.024640<br />
2011-04-08 12:57:12.693 cocos2d-project[94819:207] x position: 57.086239<br />
2011-04-08 12:57:12.693 cocos2d-project[94819:207] timedelta: 2.024640<br />
2011-04-08 12:57:12.694 cocos2d-project[94819:207] x position: 57.086239<br />
2011-04-08 12:57:12.695 cocos2d-project[94819:207] main loop update delta: 0.033744<br />
2011-04-08 12:57:12.725 cocos2d-project[94819:207] timedelta: 1.975080<br />
2011-04-08 12:57:12.726 cocos2d-project[94819:207] x position: 63.999020<br />
2011-04-08 12:57:12.726 cocos2d-project[94819:207] timedelta: 1.975080<br />
2011-04-08 12:57:12.727 cocos2d-project[94819:207] x position: 63.999020<br />
2011-04-08 12:57:12.728 cocos2d-project[94819:207] main loop update delta: 0.032918<br />
2011-04-08 12:57:12.742 cocos2d-project[94819:207] timedelta: 1.013460<br />
2011-04-08 12:57:12.744 cocos2d-project[94819:207] x position: 67.546127<br />
2011-04-08 12:57:12.748 cocos2d-project[94819:207] timedelta: 1.013460<br />
2011-04-08 12:57:12.750 cocos2d-project[94819:207] x position: 67.546127</p>
<p>The line with main loop update delta is the time delta from my main loop, it marks one cycle of movement. The timedelta lines are the timeDeltaFactor you suggested to log and the x position is the position of the object that is beeing moved. It starts out with two objects being perfectly in sync. Later when there are more shots flying around there should be pairs of projectiles with the same position.<br />
Like this:</p>
<p>2011-04-08 12:57:14.652 cocos2d-project[94819:207] main loop update delta: 0.033332<br />
2011-04-08 12:57:14.675 cocos2d-project[94819:207] timedelta: 1.999920<br />
2011-04-08 12:57:14.676 cocos2d-project[94819:207] x position: 473.536804<br />
2011-04-08 12:57:14.676 cocos2d-project[94819:207] timedelta: 1.999920<br />
2011-04-08 12:57:14.677 cocos2d-project[94819:207] x position: 473.536804<br />
2011-04-08 12:57:14.678 cocos2d-project[94819:207] timedelta: 1.999920<br />
2011-04-08 12:57:14.679 cocos2d-project[94819:207] x position: 368.221680<br />
2011-04-08 12:57:14.679 cocos2d-project[94819:207] timedelta: 1.999920<br />
2011-04-08 12:57:14.680 cocos2d-project[94819:207] x position: 368.221680<br />
2011-04-08 12:57:14.681 cocos2d-project[94819:207] timedelta: 1.999920<br />
2011-04-08 12:57:14.681 cocos2d-project[94819:207] x position: 260.032318<br />
2011-04-08 12:57:14.682 cocos2d-project[94819:207] timedelta: 1.999920<br />
2011-04-08 12:57:14.682 cocos2d-project[94819:207] x position: 260.032318<br />
2011-04-08 12:57:14.683 cocos2d-project[94819:207] timedelta: 1.999920<br />
2011-04-08 12:57:14.683 cocos2d-project[94819:207] x position: 151.519257<br />
2011-04-08 12:57:14.684 cocos2d-project[94819:207] timedelta: 1.999920<br />
2011-04-08 12:57:14.684 cocos2d-project[94819:207] x position: 151.519257</p>
<p>But then the strange thing happens and the next iteration of the loop shows this:</p>
<p>2011-04-08 12:57:14.685 cocos2d-project[94819:207] main loop update delta: 0.033332<br />
2011-04-08 12:57:14.708 cocos2d-project[94819:207] timedelta: 1.992120<br />
2011-04-08 12:57:14.709 cocos2d-project[94819:207] x position: 480.509216<br />
2011-04-08 12:57:14.729 cocos2d-project[94819:207] timedelta: 1.992120<br />
2011-04-08 12:57:14.730 cocos2d-project[94819:207] x position: 375.194092<br />
2011-04-08 12:57:14.730 cocos2d-project[94819:207] timedelta: 1.992120<br />
2011-04-08 12:57:14.731 cocos2d-project[94819:207] x position: 375.194092<br />
2011-04-08 12:57:14.732 cocos2d-project[94819:207] timedelta: 1.992120<br />
2011-04-08 12:57:14.734 cocos2d-project[94819:207] x position: 267.004730<br />
2011-04-08 12:57:14.735 cocos2d-project[94819:207] timedelta: 1.992120<br />
2011-04-08 12:57:14.735 cocos2d-project[94819:207] x position: 267.004730<br />
2011-04-08 12:57:14.736 cocos2d-project[94819:207] timedelta: 1.992120<br />
2011-04-08 12:57:14.736 cocos2d-project[94819:207] x position: 158.491669<br />
2011-04-08 12:57:14.751 cocos2d-project[94819:207] timedelta: 1.992120<br />
2011-04-08 12:57:14.751 cocos2d-project[94819:207] x position: 158.491669<br />
2011-04-08 12:57:14.752 cocos2d-project[94819:207] timedelta: 1.992120<br />
2011-04-08 12:57:14.752 cocos2d-project[94819:207] x position: 165.464081</p>
<p>It's still 8 active projectiles, but the first and the last value stand alone, no pairs. Also the first value should maybe not even exist because at more than 480px in x direction projectiles should get destroyed. </p>
<p>This is the next itteration:</p>
<p>2011-04-08 12:57:14.754 cocos2d-project[94819:207] main loop update delta: 0.033202<br />
2011-04-08 12:57:14.775 cocos2d-project[94819:207] timedelta: 3.999480<br />
2011-04-08 12:57:14.777 cocos2d-project[94819:207] x position: 487.534973<br />
2011-04-08 12:57:14.777 cocos2d-project[94819:207] timedelta: 3.999480<br />
2011-04-08 12:57:14.778 cocos2d-project[94819:207] x position: 389.192261<br />
2011-04-08 12:57:14.778 cocos2d-project[94819:207] timedelta: 3.999480<br />
2011-04-08 12:57:14.779 cocos2d-project[94819:207] x position: 281.002899<br />
2011-04-08 12:57:14.779 cocos2d-project[94819:207] timedelta: 3.999480<br />
2011-04-08 12:57:14.783 cocos2d-project[94819:207] x position: 281.002899<br />
2011-04-08 12:57:14.784 cocos2d-project[94819:207] timedelta: 3.999480<br />
2011-04-08 12:57:14.784 cocos2d-project[94819:207] x position: 172.489853<br />
2011-04-08 12:57:14.785 cocos2d-project[94819:207] timedelta: 3.999480<br />
2011-04-08 12:57:14.785 cocos2d-project[94819:207] x position: 179.462265<br />
2011-04-08 12:57:14.786 cocos2d-project[94819:207] timedelta: 3.999480<br />
2011-04-08 12:57:14.789 cocos2d-project[94819:207] x position: 63.998180<br />
2011-04-08 12:57:14.789 cocos2d-project[94819:207] timedelta: 3.999480<br />
2011-04-08 12:57:14.790 cocos2d-project[94819:207] x position: 63.998180<br />
2011-04-08 12:57:14.791 cocos2d-project[94819:207] timedelta: 3.999480<br />
2011-04-08 12:57:14.792 cocos2d-project[94819:207] x position: 77.996361</p>
<p>Now there are 9 objects where there should be an even number... I'm beginning to wonder if the problem could be totally unrelated to my movement code and be caused by the way I delete my objects. I'll do some more logging on that one and assume for now that the timedelta is not the problem.</p>
<p>Edit: I tried to solve it by changing the way objects are deleted. This resulted in screwing up the object removal so that they don't get removed at all, but at least their speed stays in sync, which means I'm on the right track I think. :)<br />
Thanks for your help Benihana!
</p></description>
		</item>
		<item>
			<title>Benihana on "Strange problem with main loop / movement"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/15368#post-87208</link>
			<pubDate>Fri, 08 Apr 2011 03:31:09 +0000</pubDate>
			<dc:creator>Benihana</dc:creator>
			<guid isPermaLink="false">87208@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Try printing the timeDeltaFactor to console (include an identifier so you know which belongs to which projectile). My bet is that it is fluctuating above and below your threshold, so sometimes it is clipping the movement (not moving as far as it should for that step).
</p></description>
		</item>
		<item>
			<title>Martin on "Strange problem with main loop / movement"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/15368#post-87205</link>
			<pubDate>Fri, 08 Apr 2011 02:20:09 +0000</pubDate>
			<dc:creator>Martin</dc:creator>
			<guid isPermaLink="false">87205@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hi! I'm having a really strange problem that I just can't fix. I have a singleton that is supposed to manage every game object. It has the update scheduled by<br />
<code>[self scheduleUpdate];</code></p>
<p>This is the complete code of the update method of this object:<br />
<pre><code>-(void) update:(ccTime)delta
{
	float d = delta; 

	for (MovingObject* obj in objectsArray)
	{
		[obj update:d];
	}
	[self collisionChecks];
	[self combat];
}</code></pre>
<p>I think that d = delta makes no sense, right? I added it as a test while trying to solve my problem.<br />
My MovingObject's update method starts like this:</p>
<pre><code>-(void) update:(ccTime)delta
	// trying to factor in the time delta for movement:
	float timeDeltaFactor = delta / ( 1.0f/60.0f );
	// capping it at 4 to avoid warping that kills collision detection
	if (timeDeltaFactor &#62; 4) timeDeltaFactor = 4.0f;
	// currentSpeed and speedMultiplier can be ignored for now, they don&#39;t change atm
	float speedLeft = currentSpeed * timeDeltaFactor * speedMultiplier;

	// this is what I&#39;m testing with now, the real movement code is more complex.
	self.position = getPointInDirectionFromLocationWithDistance(self.angle, self.position, speedLeft);
	speedLeft = 0;</code></pre>
<p>I have MovingObjects that shoot and the projectiles are MovingObjects themselves. I create two next to each other and they should be flying perfectly synchronous, but they don't. Most times but not always the left one is faster, or the right one slower depending on how you see it. But it isn't even an absolute "slower" which would increase the gap between them over time. It's like they start synchronous, after some pixels one of the projectiles starts to lag behind, catches up a little later, lags behind again, but the distance doesn't change noticably over time.<br />
How can this be? How can I debug this?<br />
I thought it might have something to do with how the director works or which type of director I choose. I tried them all out but I can't see a difference.<br />
Any help would be greatly appreciated, I'm stuck on this.
</p></description>
		</item>
		<item>
			<title>karlth on "runWithScene and memory"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/2327#post-87075</link>
			<pubDate>Thu, 07 Apr 2011 09:52:00 +0000</pubDate>
			<dc:creator>karlth</dc:creator>
			<guid isPermaLink="false">87075@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>There is a leak there.  The first scene is PushScene-ed which increases the reference count.  When the first scene is replaced by another one the first one is still retained.</p>
<p>I fixed it by simply releasing the first scene immediately after runWithScene.</p>
<p>A more robust patch should be implemented though, hopefully by a more knowledgeable Cocos2d coder than me.
</p></description>
		</item>
		<item>
			<title>Cold on "How does one create a transparent director view for the Mac?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/14631#post-84162</link>
			<pubDate>Thu, 24 Mar 2011 00:38:47 +0000</pubDate>
			<dc:creator>Cold</dc:creator>
			<guid isPermaLink="false">84162@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Anyone who can spill the beans on making the MacGLView Transparent would be an absolute champion...
</p></description>
		</item>
		<item>
			<title>mrTortex on "How does one create a transparent director view for the Mac?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/14631#post-83073</link>
			<pubDate>Thu, 17 Mar 2011 21:32:38 +0000</pubDate>
			<dc:creator>mrTortex</dc:creator>
			<guid isPermaLink="false">83073@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I'd also like to know how to do this.  Along with adding Quicktime Movies to my Cocos2D Mac projects :)
</p></description>
		</item>

	</channel>
</rss>

