im a 12 year old self taught developer developer working on a game in which particles would make the game amazing. Though i already have particles i would like to know how to add particles after a collision. Though many actions already happen i would like to add another, here is my code.
(void)didEndContact:(SKPhysicsContact *)contact {
if (contact.bodyA.categoryBitMask == rectangulo && contact.bodyB.categoryBitMask == circulo) {
count.text = [NSString stringWithFormat:@"%ld points", ++collisionsCount];
[contact.bodyB.node removeFromParent];
MyParticlez = [NSKeyedUnarchiver unarchiveObjectWithFile:[[NSBundle mainBundle]
pathForResource:@"MyParticlez" ofType:@"sks"]];}}
i don't know whether i should add a certain CGPoint or an addChild or something else to make the particles appear over the block "rectangulo"
thank you, <3
You've got a good start, you've created the particles, but now you need to add the particles to the scene in the same way you've added the other sprites to the scene. So, you'll call:
You may want to have a way to remove the particle emitter from the scene when they are finished.