The main idea is, is you set the Particle Motion to the player's direction with set variable; here is a code that does that with the explanation:
[Template]
It repeats 5 times (so we get 5 particles), inside the repeat, the first block multiplies the player's direction by 5, so the fire will go 5x more, you can change the number if you want your flame to be able to go closer or further, the 2nd block inside the repeat creates our particle, I used a Flame particle with 0.1 0.1 spread so the flame looks a bit random with the variable in the 1st block as the vector parameter and a number 8 as the motion randomizer (you can put whatever you want, but i found 8 to be good) and i display the particle in the 3rd block inside the repeat. and the 4th block is just so they don't spawn in wave and rather they spawn "randomly". wait %random(0,1) has a 50% chance to wait a tick or not so it seems better