
这个开了debug模式,像现在这种根本动不了,真机上也一样,看了系统资源是cpu占用太高了。

这张是去掉debug模式的,看了帧数都到60了,还是很卡。也是cup占用高。
下面是我的加载
Vec2 cpvertices;
int nVertices = 0;
for (int i=0; i<5000; i++)
{
cpvertices = Vec2(i+1, i + arc4random()%3+2);
nVertices++;
}
auto wall = Node::create();
wall->setPhysicsBody(PhysicsBody::createEdgeChain(cpvertices, nVertices));
addChild(wall);
MoveBy* move = MoveBy::create(2.0f, Vec2(100, 100));
MoveBy* move2 = MoveBy::create(2.0f, Vec2(-200, 0));
MoveBy* move3 = MoveBy::create(2.0f, Vec2(100, -100));
ScaleTo* scale = ScaleTo::create(3.0f, 0.3f);
ScaleTo* scale2 = ScaleTo::create(3.0f, 1.0f);
RotateBy* rotate = RotateBy::create(6.0f, 360);
让整个layer动起来
this->runAction(RepeatForever::create(Sequence::create(move, move2, move3, nullptr)));
