Page 1 of 1

how to make a particle explosion

PostPosted: Mon Oct 04, 2010 7:30 am
by smoothie
i have made a bullet and when the bullet collides with the wall a would like to make an explosion with a particle. i have made the particle but i was wondering how to do is so that when the bullet explosdes lots of particles come out not just one.

Re: how to make a particle explosion

PostPosted: Mon Oct 04, 2010 7:34 am
by skydereign
A simple way as follows. You can create smarter particle effects through similar methods, but usually this one will do.

Bullet -> Collision with wall -> Script Editor
Code: Select all
int i;
for(i=0;i<10;i++)
{
    CreateActor("fx", "fx_anim", "(none)", "(none)", 0, 0, false);
}


fx -> Create Actor -> Script Editor
Code: Select all
xvelocity = rand(5)-rand(5);
yvelocity = rand(5)-rand(5);


You'll want to have the fx destroyed after a while, so you can use a timer or animation finish for that.

Re: how to make a particle explosion

PostPosted: Mon Oct 04, 2010 7:36 am
by smoothie
thank you for your awesomeness but instead of it making particles it just made the bullets spread and they just went through the wall but thank you for that having the bullets was a very nice feature. but i would still like to know how to make it so that when the bullets hot the wall particles spread.