There isn't much document on the site about Particle System with cocos2d.
Can someone give me a hint on the basics?
Many thanks!
day
A fast, easy to use, free, and community supported 2D game engine
There isn't much document on the site about Particle System with cocos2d.
Can someone give me a hint on the basics?
Many thanks!
day
Yeah there may not be a full documentation but if you look at ParticleTest.m it's actually helps understand how to create and use particles. Running the test will show what the particles do for each case. And the source code isn't all that difficult to grasp if you take the time to understand each line.
I'm having slight problems here too, I inherited and overrode a ColorLayer like in the example and later thought it wasn't necessary. I've got it down to my overriden PointParticleSystem class (Which currently just has a copy/pasted initWithTotalParticles method from the aforementioned ParticleTest.m, identical apart from duration) but I can't ever see it when my code is running.
This code is in an overriden layer class:
MyPointParticleSystem * emit = [[MyPointParticleSystem alloc]initWithTotalParticles:150];
emit.position = someCGPointPositionOnScreen;
emit.autoRemoveOnFinish = YES;
[self addChild:emit];
[emit release];
Am I missing something stupid?
Have you taken a look at "ParticleExamples.h" (and it's associated .m file, of course :P)?
It gives really good examples of subclassing PointParticleSystem to create all kinds of effects. What I usually do is pick one as a starting point, copy and paste it into its own class and tweak the values from there.
Which, looking closer at your post, is similar to what you've already done without the added complication of a subclassed ColorLayer.
Are you able to successfully add one of the pre-fab systems included in ParticleExamples.h?
Thanks for making me go back and look - Turned out it was a problem with auto-assigning the Z-layering for nothing but the emitter.
You forgot to poit out what kind of particle sys you want. Like emit = [Particle??? node]; May be that's why this thing did not show in ur Prj!
Hope help!
You must log in to post.