r/ProgrammingPrompts • u/deanmsands3 • Jun 14 '18
[Medium] Fire Effect in TEXT
Back in the Mode 13h days, the fire routine used to be one of the fun "first projects" for people playing with graphics. A line of random data would be generated and then smoothed upward. The numbers would correspond to a palette of available colors. An extra vertical bump would give the flame a smoother, less smoky look.
But that's too easy. Let's do it in Text mode.
In text you have to set the Foreground color, the Background color, the Attribute (blinking, hi-intensity/bright) and then actual character.
You can either use a portable library like NCurses or the OS console API (for example: https://docs.microsoft.com/en-us/windows/console/console-reference ). Escape codes will maybe work if you're using Linux, but not Windows.
If you post your code, make sure to list which OS you're using.
Happy programming!
View all comments
Show parent comment
1
u/deanmsands3 Nov 23 '18
Go for it!