开发者

can moving many sprites using scheduler in one scene slow down simulator

开发者 https://www.devze.com 2022-12-10 21:53 出处:网络
I am developing a ga开发者_Python百科me in which i have 10-12 sprite moving at a time in one scene can that slow down the simulator? in my game if i click on sprite moving at top i.e. plane from which

I am developing a ga开发者_Python百科me in which i have 10-12 sprite moving at a time in one scene can that slow down the simulator? in my game if i click on sprite moving at top i.e. plane from which humans jump down. so if one click continuously 6 or 7 times at time 6 or 7 sprites appear and it slow down. i have not tested on iphone but its slow down's simulator. m using scheduler to move all images. does it affect.


Having a lot of sprites can slow down the simulator as well as the iPhone.

This is because the texture buffer needs to be swapped out a lot. This is an expensive operation.

Consider using AtlasSprite instead. They are much faster. Even if your sprites use different images, consider putting them in one texture and then use the AtlasSpriteManager and AtlasSprite to draw them to the screen.

Also, if you have 10 sprites with the same Texture2D object it speeds things up (but only if they are rendered without swapping the texture buffer, which can be a pain to optimize.)

Using a scheduler to move them should be fine.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号