from Hacker News

Show HN: I've re-implemented the Doom fire effect in plain JavaScript

by filipedeschamps on 1/5/19, 7:45 PM with 22 comments

  • by fabiensanglard on 1/5/19, 8:52 PM

    The original reverse-engineering done by Samuel Villarreal was already using javascript. I assume by "plain" you mean you removed easeljs library for canvas management and added buttons?
  • by ricardobeat on 1/5/19, 8:09 PM

    Maybe it wasn't clear in the original article [1], but what you see inline are javascript implementations of the effect - there is a link to the source code at the end:

    https://codepen.io/svkaiser/pen/xXmOvY

    [1] http://fabiensanglard.net/doom_fire_psx/

  • by mrspeaker on 1/5/19, 8:29 PM

    I first learned to do this effect in 1999 thanks to the incredible Denthor/Asphexia tutorials. I looked forward to new releases of these that my friend would (somehow) get and give to me on a floppy disk.

    Most of them were in Pascal, but the fire one was in asm (http://archive.gamedev.net/archive/reference/articles/articl...) - it was the first time that assembler really clicked for me!

  • by z3t4 on 1/5/19, 8:03 PM

    It's a bit slow. I suggest 1) Use existing table instead of creating a new table at each frame/interval. 2) Or use Canvas because DOM is so slow 3) requestAnimationFrame instead of setInterval
  • by mmphosis on 1/5/19, 9:10 PM

    Apple ][ Fire Demo -- 64 Bytes http://deater.net/weave/vmwprod/apple2_fire/
  • by 21 on 1/5/19, 8:50 PM

    But can you implement JavaScript in Doom?
  • by berkut on 1/5/19, 9:23 PM

    Didn't MS VC++ 4 to 6 ship with an example which emulated this effect as well via a custom control?

    There were different tabs for things like "wood", "gas", "cryptonite" which changed the overall colour of the effect.

  • by Ayraa on 1/5/19, 9:25 PM

    It would be really cool if you could paste the url to an image, have a generator overlay the fire effect on top, and you can save that as a gif.