Skip to content

Limekys/AdvancedParticleSystem

Repository files navigation

AdvancedParticleSystem

Check out wiki page! https://github.com/Limekys/AdvancedParticleSystem/wiki/Main

Advanced Particle System wiki

Compare

Simple particle code example

Simple example

All functions looks like standart gms particle system. We are create particle system, emitter and particle type. Simple example init

For our particle system to work, we need to add a step function to the step event. And of course to create our particles need to run burst function almost like the standard system, all functions look identical, except that at the beginning ascribed to "advanced_".

Step and Burst function

But in order for our particles to be visible, they need to be drawn on the screen, for this you just need to run the draw function in the "draw" event.

Draw function

Done!

Simple particle example


Why advanced?

Point gravity

Because, as first, we have part_point_gravity function!

Point gravity function

Point gravity particles

Delta time

And, as second, we have delta time! Which give us a huge control with particles speed! At low and high FPS we have the same speed of particles. To turn on delta time just put enabledelta() function to create event after creating particle system. With delta enabled you should remember to setup right speed, gravity amount and life values! For example without deltatime we should setup life 60 for 1 second life for this particle with room speed 60 and with deltatime we should setup life to 1 for 1 second life regardless room speed. For burst particles with advanced_part_emitter_burst function without deltatime 1 for 60 particles each second with room speed 60 and with deltatime 60 to burst 60 particle within a second!

Deltatime fucntion

Example with 15 FPS: left particles is standart GMS2 particle system, middle is advanced particle system without deltatime and right with deltatime.

Deltatime example

Collisions

For collisions we have part_step_function. With which we can add what you want including collisions!

For example collisions with objects:

Code

And result is:

Collision with objects

Distance to mouse:

Code Result

Or just a rain:

Code Rain drops


Fireworks!

Code

Firework code

One part burst and thats all

burst functions

And how it looks!

Firework


Conclusion

We have a very interesting particle system with functions that are not in the standard particle system, but not the most productive! I try to do my best to optimize it. If you like, you can help develop this project!