Flint Particle System Forum - What is the best way to create a "thrust" effect?2010-12-25T16:41:14+00:00http://flintparticles.org/forum/
Lussumo Vanilla & Feed Publisher
What is the best way to create a "thrust" effect?http://flintparticles.org/forum/comments.php?DiscussionID=19&Focus=103#Comment_1032008-04-16T02:29:53+01:002008-05-20T10:08:03+01:00robotzhttp://flintparticles.org/forum/account.php?u=21
Hi,
I've been playing with Flint 1.0.1 a lot tonight, and was just wondering what you all considered to be the "safest / best practise" way to create a thrust effect for a game? Imagine ...
I've been playing with Flint 1.0.1 a lot tonight, and was just wondering what you all considered to be the "safest / best practise" way to create a thrust effect for a game? Imagine Asteroids and a particle trail flowing out of the ship when it moves around - it would only emit particles when the thrust key was being held down.
So far I have created a DiscSectorZone to fit the "shape" of the exhaust that I want. I then position this in the right location below the ship, and rotate and position it accordingly based on keyboard input, but I'm having trouble getting it to "emit" in a nice way. At the moment it's set to "Blast(200)" when the thrust key is pressed, but really I want to ease the amount of particles being emitted as thrust is held down, up to a maximum limit, and somehow make the velocity of them match that of the ship moving.
I'm having trouble figuring out the best way to modify attributes like this for an already created emitter - so, anyone?!
Cheers,
Rich]]>
What is the best way to create a "thrust" effect?http://flintparticles.org/forum/comments.php?DiscussionID=19&Focus=104#Comment_1042008-04-16T09:34:03+01:002010-12-25T16:41:14+00:00Richardhttp://flintparticles.org/forum/account.php?u=1
Hi Rich
The ideal way is to create your own custom counter. If you look at the Counter interface, there's only two methods you need to implement - startEmitter and updateEmitter. Each returns the ...
The ideal way is to create your own custom counter. If you look at the Counter interface, there's only two methods you need to implement - startEmitter and updateEmitter. Each returns the number of particles the emitter should create at this time. For your custom counter, startEmitter will return 0, and updateEmitter will return a number depending on both the time parameter (this is the time that passed since the last call to the method) and the state of the thrust key. Take a look at the other counters for more clues.
Come to think of it, a counter that only emits when a key is down would be a good idea for the library. Just not sure when I'll have time to do it so you're better off having a go yourself rather than waiting for me.
For the velocity bit, you'll need a custom initializer, similar to the Velocity initializer but using the ships velocity as a basis for the particle velocity.