I'm creating a side-scrolling game using Matter.JS, in this game one of heros is made of fire, so he needs to get some smoke, but I dont know how to make particles floating in the air, how I can make a float body in Matter.JS?
I want something like this: https://www.youtube.com/watch?v=b-QhKcae-6E
Please see my codepen here: http://codepen.io/vanuatu/pen/VeQMpp
What you're looking for is a particle system. There's nothing currently built in to the engine for this, it's more of something you'd find in a game engine so it's a bit out of scope.
You could build your own by to defining a particle object (position, velocity, lifetime etc) and then use the engine update event to update the particle positions, then render them to the same canvas as the physics objects. The built in body type could be somewhat reusable for this (don't add it to the world, instead create your own particle world).
thanks for the clear explanation, @liabru
No problem!
I created a fake smoke effect by using spheres and a PNG of something that resembles (black) smoke.
Most helpful comment
What you're looking for is a particle system. There's nothing currently built in to the engine for this, it's more of something you'd find in a game engine so it's a bit out of scope.
You could build your own by to defining a particle object (position, velocity, lifetime etc) and then use the engine update event to update the particle positions, then render them to the same canvas as the physics objects. The built in body type could be somewhat reusable for this (don't add it to the world, instead create your own particle world).