Meagan's Particles' speed
#4
Hm. I re-read your initial request, and thought about how the particles spat out from the clown running around the track in my demo. You know, the one where you pressed one of the buttons and left a flurry of red particles in his wake. If you're bogged down by too many particles appearing at a given time, it's based on your event code and how you use the script calls within.

The number of particles appearing from the event is solely based upon how many frames you wait and how many calls are made. And the particle spread behind the clown (defined in event ID 10) is generated thus:
Code:
@script: particle_fx(9,'sparks','screen')
@script: particle_fx(9,'sparks','screen')
@script: particle_fx(9,'sparks','screen')
@script: particle_fx(9,'sparks','screen')

In doing so, I make four trailing particles every frame that the user presses the 'X' button (aka the 'A' keyboard key). To slow down generation, one can add @wait_count = 3 to slow this down to run only after 3 frames of animation speed, and remove one or more particle effect calls to reduce the number generated at any given time.
Code:
@script: @wait_count = 3
@script: particle_fx(9,'sparks','screen')
@script: particle_fx(9,'sparks','screen')

How fast they move from their point of origin, aka its velocity, is solely within the P_Defined array... particularly the 'horizontal' and 'vertical' arrays within. Each one of those arrays holds 3 values which manipulates its speed and gives a little random variance value. Hey, you don't want all the particles to move EXACTLY the same, right?

The first two values in the Horiz & Vert arrays handle direction in pixels. In the case of the sparks in my demo, this is set to -5, 10. This means it can go 5 px in one direction with a randomization of 1-10 pixels in another direction (ie... -4px to 5px) whether this is the horizontal or vertical array. Granted, that is TOO fast with the system's 40FPS frame rate, so the array has a 3rd value to slow the particle speed down... the multiplier. Again, using the sparks particle in my demo, I have this set to 0.5, but you could set that to 0.3 to make them travel slower from their point of generation or even 0.1. You could even make the particles remain stationary and not move at all. But to do so, do not enter a value of 0. The value must be 0.0 for a stationary particle as the value itself MUST be a floating point value.

* The Velocity value and formula I mentioned is covered in the demo's PDF file

The speed in which the particles fade away is based on the 'Opacity' array within P_Defined, and also has a little 'variance' option within. And after that, you have a 'Spin' array which indicates how fast the particles spin and in which direction. Granted, a spin of 0 means it isn't spinning at all.

Sorry for the late summary, but I've been busy working. With that, you shouldn't have need for my previous code insert from a couple days ago. Tongue sticking out
Up is down, left is right and sideways is straight ahead. - Cord "Circle of Iron", 1978 (written by Bruce Lee and James Coburn... really...)

[Image: QrnbKlx.jpg]
[Image: sGz1ErF.png]    [Image: liM4ikn.png]    [Image: fdzKgZA.png]    [Image: sj0H81z.png]
[Image: QL7oRau.png]    [Image: uSqjY09.png]    [Image: GAA3qE9.png]    [Image: 2Hmnx1G.png]    [Image: BwtNdKw.png%5B]
  Above are clickable links
}


Messages In This Thread
Meagan's Particles' speed - by Raou - 03-27-2015, 05:56 PM
RE: Meagan's Particles' speed - by DerVVulfman - 03-28-2015, 04:25 AM
RE: Meagan's Particles' speed - by Raou - 03-28-2015, 01:35 PM
RE: Meagan's Particles' speed - by DerVVulfman - 03-29-2015, 06:32 PM
RE: Meagan's Particles' speed - by Raou - 04-01-2015, 03:56 AM
RE: Meagan's Particles' speed - by DerVVulfman - 04-01-2015, 04:00 AM
RE: Meagan's Particles' speed - by Raou - 04-01-2015, 03:43 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
   Possible means to speed up Bitmap TONE code? DerVVulfman 7 3,098 06-11-2023, 08:22 PM
Last Post: kyonides
   Permanently modifying move speed Keeroh 5 9,613 05-24-2017, 05:47 AM
Last Post: DerVVulfman
   Pixelmovement and speed ark 2 5,662 05-31-2010, 05:51 PM
Last Post: ark



Users browsing this thread: 3 Guest(s)