MCPcopy Create free account
hub / github.com/axmolengine/axmol / removeSystem

Method removeSystem

tests/cpp-tests/Source/ParticleTest/ParticleTest.cpp:2791–2812  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2789}
2790
2791void AddAndDeleteParticleSystems::removeSystem(float dt)
2792{
2793 ssize_t nChildrenCount = _batchNode->getChildren().size();
2794 if (nChildrenCount > 0)
2795 {
2796 AXLOGD("remove random system");
2797 unsigned int uRand = rand() % (nChildrenCount - 1);
2798 _batchNode->removeChild(_batchNode->getChildren().at(uRand), true);
2799
2800 auto particleSystem = ParticleSystemQuad::create("Particles/Spiral.plist");
2801 // add new
2802
2803 particleSystem->setPositionType(ParticleSystem::PositionType::GROUPED);
2804 particleSystem->setTotalParticles(200);
2805
2806 particleSystem->setPosition(Vec2(rand() % 300, rand() % 400));
2807
2808 AXLOGD("add a new system");
2809 unsigned int randZ = rand() % 100;
2810 _batchNode->addChild(particleSystem, randZ, -1);
2811 }
2812}
2813
2814void AddAndDeleteParticleSystems::update(float dt)
2815{

Callers

nothing calls this directly

Calls 9

createFunction · 0.85
setPositionTypeMethod · 0.80
Vec2Function · 0.50
sizeMethod · 0.45
removeChildMethod · 0.45
atMethod · 0.45
setTotalParticlesMethod · 0.45
setPositionMethod · 0.45
addChildMethod · 0.45

Tested by

no test coverage detected