Game error

I am developing a game where I need to move a ball and trigger an image at the same time. To move the image with the image enabled, create a separate thread and call the move method with [self performSelectorOnMainThread: ..] to display the updated position in the view. But my game slows down after creating this theme. please help me to improve the performance of the game.

0


a source to share


3 answers


You probably don't want to create your own thread here; which is probably slower than doing this work on the main thread, unless your computation is incredibly complex.



Instead of creating your own streams, explore CoreAnimation . It's designed to smoothly move things around, manage its flows transparently, and provide a "fire-and-forget" interface. For most 2D games, the first approach to follow is CALayers for each element moved using CoreAnimation.

+1


a source


We did not develop or write your game, so how can you expect us to find out how to fix it? Do some research yourself, use Apple's excellent Tools and Shark to track issues.



+1


a source


I highly recommend you take a look at cocos2d instead of manually manipulating sprites and graphics. Cocos2d will distract you from all this.

0


a source







All Articles