Make flame with Elm

A friend of mine, Roger Engel­ber, point­ed me to a nice arti­cle  on doing func­tion­al pro­gram­ming in Lua. The arti­cle detailed the steps to gen­er­ate a flame like effects using a sim­ple par­ti­cle sys­tem.

Of course, it nat­u­ral­ly lead to me try­ing to do the same in Elm!

 

To trans­late the approach was real­ly straight for­ward, though there are some minor dif­fer­ences, e.g. alpha val­ues in Elm are between 0 to 1 but 0 to 255 in Lua.

 

The code is avail­able on github, feel free to poke around.

Here are two vari­a­tions in action:

 

Links

Source code

Live demo 1

Live demo 2

Live demo 3

Live demo 4