The Daily Click ::. Forums ::. Klik Coding Help ::. random particle effects
 

Post Reply  Post Oekaki 
 

Posted By Message

siven

I EAT ROCKS

Registered
  03/11/2008
Points
  604

Wii OwnerVIP Member
16th January, 2009 at 01:13:04 -

is it possible (and if so how) to make random particle effects for things such as fire, explosions, energy trails etc?

 
[Game design makes my brain feel like its gonna explode.]

traugott.simon



Registered
  23/08/2008
Points
  91
17th January, 2009 at 19:00:36 -

Of course.

Theres an extension for this but if you want to do it on your own just create your particle objects and set their movement directions to random for example.

Mayby you could specify your question a littlebit

 
n/a

OMC

What a goofball

Registered
  21/05/2007
Points
  3309

KlikCast Musician! Guy with a HatSomewhat CrazyARGH SignLikes TDCHas Donated, Thank You!Retired Admin
17th January, 2009 at 23:12:57 -

Hmm, a nice way to do random particles: (simplified form)

Always >> Create object outside of play area.

Value (or flag or whatever) = 0 >> Set value to 1 and place particle where the origin is. (Nice for when you need the particle to be behind whatever it's spewing out of; if it's at the origin from the start, you can't set it behind the object fast enough) AND Set Value A to (random(5)-3) AND Value B to (random(5)-3).

Always >> Set particle XPos to current Position + Value A. AND set particle YPos to current position - Value B.

If you want to have gravity, add this to the always condition: Add 1 to value B

Voila! Simple particle effect. You can adjust the random values if you need it to be skinnier or wider or taller or shorter. (If something is backwards and the particles fly up, it's because sometimes I get confused as to whether the Y starts at the top or bottom. Believe it or not, sometimes it flips around for me in TGF. O_O)

Also, if you don't want the origin to be one spot, you can set the X and Y positions to the origin + random(whatever number)-(half of that number)

I think that makes sense. O_o

 

  		
  		

siven

I EAT ROCKS

Registered
  03/11/2008
Points
  604

Wii OwnerVIP Member
17th January, 2009 at 23:24:57 -

its a bit confusing, but i believe i can figure it out, also, for the more specific thing, i meant what i said, explosions and fire. so multicolored things, because im terrible at fire anims same with explosion, plus it would be cool to do random particles, would match better, ill give your example a try clayton.

 
[Game design makes my brain feel like its gonna explode.]

OMC

What a goofball

Registered
  21/05/2007
Points
  3309

KlikCast Musician! Guy with a HatSomewhat CrazyARGH SignLikes TDCHas Donated, Thank You!Retired Admin
17th January, 2009 at 23:30:32 -

You may be able to get an acceptable flame out of it if you slow down the speed at which it moves (make the random number generator generate a lower number) and have the animation start out as a small white flameblob, slowly grow to a bigger yellow, then a smaller orange, an even smaller red, and then fizzle into black smoke if you want. (Or make smoke a separate particle effect.) You'd also need to make it go up instead of down.

All examples are confusing when you first see them. Once you get it to work you'll usually get it to snap together in your head.

Edited by OMC

 

  		
  		

dndfreak



Registered
  11/01/2009
Points
  650
18th January, 2009 at 04:43:38 -

why don't you try the flame object?

 
Vegeta? What does your mother say about my power level?

ITS OVER 9000!!!

siven

I EAT ROCKS

Registered
  03/11/2008
Points
  604

Wii OwnerVIP Member
19th January, 2009 at 02:35:01 -

thanks klayton, ill give it a shot, i just got finished changing the main character sprites of the game (big pain lol and time waister lol)
oh and dndfreak, the flame object slows the game down way to much to use in a scrolling game, trust me, it was my first thought on my last game, which didnt work out.

 
[Game design makes my brain feel like its gonna explode.]

OMC

What a goofball

Registered
  21/05/2007
Points
  3309

KlikCast Musician! Guy with a HatSomewhat CrazyARGH SignLikes TDCHas Donated, Thank You!Retired Admin
19th January, 2009 at 02:36:55 -

Tell us how it goes!

 

  		
  		

siven

I EAT ROCKS

Registered
  03/11/2008
Points
  604

Wii OwnerVIP Member
19th January, 2009 at 02:41:06 -

can do, gimme just a min to try it out

 
[Game design makes my brain feel like its gonna explode.]

siven

I EAT ROCKS

Registered
  03/11/2008
Points
  604

Wii OwnerVIP Member
19th January, 2009 at 02:54:47 -

hmm, it just makes little dots, i may have done something wrong, i dont mean to be a bother, but could you do a little example for me? please?

 
[Game design makes my brain feel like its gonna explode.]

OMC

What a goofball

Registered
  21/05/2007
Points
  3309

KlikCast Musician! Guy with a HatSomewhat CrazyARGH SignLikes TDCHas Donated, Thank You!Retired Admin
5th March, 2009 at 22:34:45 -

Did you ever get this figured out siven?

 

  		
  		
   

Post Reply



 



Advertisement

Worth A Click