Tuesday, December 22, 2009

Loving it!

This working an hour a day at work thing is really working out.  I bring my laptop in and set it up at lunch time to do some coding!

Well, I've managed to completely code the TMParticleFX system and got it working to the point where I am now playing with special effects :)  By far particle effects are the most fun to code.

The system I've got working, is working exactly as designed.  Particle Parameters are controlled by "ghost" values that can be made into Sequencers.  The Sequencers work by passing from a start value to an end value in a given amount of time.  For example,

TMSequencer=TMSequencer.Create(0,1,5) would create a value that would increase from 0 to 1 over a period of 5 seconds and then stopped there ( ModeOnce).  There are options as well, they can be set to "ModeBounce" to go back and forth 0 to 1 to 0... , ModeRoll which is 0 to 1 to 0... and even more, they can be chained together by adding nodes... as many as you wish.. so long as they all total up to the set life of the particle (in seconds as well)

All the particle system does is keep a list of active sequencers, updates those, and then when the particle is updating, it uses for example...
If Self.dVel then Self.Vel=dVel.Value()  ' quite efficient really.

Also, Particles have been extended to Emitters... the emitters keep a loaded array of particle definitions, and even emitter definitions.. the spread, rate, angle, and velocity of the emitted particles are sequence controlled as well... As is the array positions

The possibilities are endless and so far is works sweet!  Now just to reign in the chaos that level of control creates and make some really pretty special effects :)   I already have a missile launching to the middle of the screen, exploding into 32 animated particles, and then those again explode and scale large while fading to 0 alpha.

Tomorrow is another day...

No comments:

Post a Comment