🔥 Fire Doom Simulator 🔥

by FranciscoCharles

An interactive Doom fire simulator with a simple options menu developed in Python + Pygame. In this project it is possible to change the amount of fps, flame decay, wind direction, wind force and make it possible to change the colors of the flames in the HSL(hue, saturation, lightness) color space, in addition to allowing to turn on/off the flames.

The program has 8 adjustable options and allows you to use the Q key to turn the fire on/off. The options currently available are:

  • FPS:
    • option to control the SPF, ranging from 10 to 60.
  • Decay:
    • option to control the intensity with which the flames lose strength, varying from 1 to (1-amount of colors available in the color palette).
  • Wind direction:
    • option to control the wind direction, having 3 modes: right, left and both.
  • Wind force:
    • option to control the wind force, ranging from 0 to 10.
  • Color intensity:
    • control option to change the color palette, varies from True to False.

The options below can only be changed if color intensity is True.

  • H:
    • option to control the H component (hue) of the color, ranging from 0 to 360.
  • S:
    • option to control the S component (saturation) of the color, ranging from 0.0 to 1.0.
  • L:
    • option to control the L component (brightness) of the color, ranging from 0.0 to 1.0
  • use ESC to exit/close the program.
  • use Q to turn the flames on/off 🔥.
  • use W or: arrow_up: to select the menu above.
  • use Z or: arrow_down: to select the menu below.
  • use S or: arrow_right: to increase / change the value of the selected menu.
  • use A or: arrow_left: to decrement / change the value of the selected menu.

The image below is a demonstration of the colors that are possible for the flames.

Download the project, install the dependencies, enter the src folder and execute:

python main.py

This project is based on a video from @filipedeschamps , where he brings a doom fire algorithm that he implemented, in the video he explains how the algorithm works in a didactic, practical and simple way. My thanks for sharing your knowledge, diverse and fun content.

  • Pygame == 1.9.6.
  • Python == 3.7 or higher.
  • current version of the project: 1.0.1.

For more information on the license for this project read the LICENSE file.


Copyright © 2021 FranciscoCharles