Hi,
Ok, so how you protect critical blocks of code? ie When you are making a loop you don't want that Touches be launched till you finish the loop.
With @synchronized , with a custom flag?
Regards,
Pablo
A fast, easy to use, free, and community supported 2D game engine
Hi,
Ok, so how you protect critical blocks of code? ie When you are making a loop you don't want that Touches be launched till you finish the loop.
With @synchronized , with a custom flag?
Regards,
Pablo
Question: Are you running multiple threads?
You are right, with cocos 2d this shouldn't be a problem.
Anyhow, I reived comments that the better way is going via the @synchronized way.
The better way is to go with multiple threads? I think it depends on what you're trying to accomplish.
Can you point to me where you read that? Kind of interested in reading about it.
I didn't say that the better way is going with multiple threads.
I just say that if you go with multithread app you should control critical code with the @synchronized
I see, and that is definitely true.
Should I use @synchronized to ensure that the transition completes before I spawn the balls at the beginning of the game scene?
I am also interested in using @synchronized with regard to transitions between scenes in my Cocos2d game. I have 21 chipmunk circle shapes that spawn in a fixed space when the game scene is started. I understand what @synchronized does from reading this on stackoverflow. I think that the slow transition fade is affecting the timers and the physics that are running in my game. My project is made of an app delegate containing a sharedDirector that passes transitions between scenes using this code:
GameScene * gs = [GameScene node];
[[Director sharedDirector] replaceScene:
[FadeTransition transitionWithDuration:1.0f scene:gs]];You must log in to post.