删除MANY CCSprites [英] Removing MANY CCSprites

查看:150
本文介绍了删除MANY CCSprites的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿,男孩和女孩。
我有一个方法创建CCSprite类类型的雨颗粒,微小的图像。
一切都很好,当云降雨,他们下雨CCSprites的许多粒子,直到他们离开垂直winsize空间..
一旦他们离开垂直winsize空间,iphone模拟器开始滞后删除每个下雨CCSprite。

Hey guys and girls. I have a method that creates rain particles, tiny images, of CCSprite class type. Everything is working well, when the clouds rain, they rain many particles of CCSprites until they leave the vertical winsize space.. Once they do leave the vertical winsize space, the iphone simulator begins to lag as it removes each rain CCSprite.

我认为问题是他们有这么多CCsprites要删除,而不是在内存中的实际需求。

I think the problem is that their are so many CCsprites to remove, not the actual demand of having them in the memory.

我的删除精灵的方法每秒钟调用60次。我尝试可能改变删除的频率为1/1秒,但没有效果,它使它更加滞后,因为更多的精灵删除一次...

My method to remove sprites is called 60 times per second. I tried perhaps changing the frequency of deletion to 1/1second, but to no avail, its made it more laggy because theres more sprites to delete at once...

我可以去解决这个问题,或者我使用CCsprite无效,是否有更好的类使用?

How could I go about fixing this problem, or am i using CCsprite ineffectively, is there a better Class to use?

推荐答案

一个粒子例子..这是雨颗粒..

There is a particle example.. which is rain particle..

每秒调用函数30次..我不知道为什么删除会滞后..

call the function 30 times per second.. i am not sure why removing would lag..

这篇关于删除MANY CCSprites的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆