Ok for those interested the fire stuff is all done by a single algorithm. No images or assets are used nor any fading. All pixel values are caculated.
There are 2 problems with fuze to achieve a fire a effect:
- it does not have a getpixel routine
- it does not have an indexed collor pallete mode like 13h / VGA in the dos days.
However you can simulate these by creating a virtual screen array and a collor pallete array. The virtual screen contains indexes (colors) and link to the collor pallete array containing the real colors. Pallettes were used to do color tricks, you can setup a color pallete with some gradients (as is done here). Other tricks you can do is animate colors by just shifting the color pallete array. So now we have VGA / INT13h mode sorted. And we also solved the missing getpixel routine as we can lookup the color in the virtual screen array.
The fire algorithm works by taking an average of neighbouring pixels (i used 4) but 2 pixel use same color for 1 pixel. These "colors" (actually indexes referencing the color pallete array) are added up and the divided to get the average.
The algorithm only does the calucaltion but you also have to feed it "heat" or info. Anything except color 0 (black) will transform and you basically have to draw a line at the bottom of the screen and the algoritm applied the to rest of the screen (except this feeding line does the rest).
So the little flames in the beginning is just setting a single pixel at the bottom and it creates those little fires and they remain as the fire effect is not applied on the last line. The fading smoke stuff after that is just drawing random pixels at certain heat (pixel indexed color at the screen). The Letters are just lines being drawn again with certain heat and the fire algorithm does the rest. the big fire at the bottom is basically drawing a line except a few pixel at the bottom feeding line and the fire going dark again is basically drawing pixel color 0 (black) at the bottom again. And to make the letters fade out to smoke is basically stop drawing the letters.
Now there is one little problem, you have to draw / put pixels in the virtual screen array as thats whats using the indexed colors. so i just use a few for loops to draw straight lines to form the word C L E A N and the rest is done by the fire algorithm.
afterwards its just timing everything a bit to the music with a timer (based on time()) function.
Now doing this virtual screen in fuze is slow it seems thats why i only have 160x100 virtual screen and use setmode 160x100 i even had to remove the functions getpixel and putpixel as i intially did and place them directly in the main loop as doing just many calls to getpixel / putpixel created slownes due to the intrepreted aspect of it all. (thats why you don't see getpixel / putpixel routines but they are done just directly).
Anyway i based my code on this routine here
There are more explanations of this fire effect here for example:
http://www.retroarchive.org/swag/EGAVGA/0204.PAS.html
i wish fuze had a 256 color palleted color mode as you could more nice effects then :)