I would like to create a game similar to powder game.
I’ve got a 2d array that stores different types of powder such as sand, water, gas, and fire. I’ve managed to get these to all move around successfully.
I would now like the powders to react to wind. For example if there is fire it should push air upwards. If the air is moving upwards it will move other bits of powder around.
The way I’ve been trying is to have two more 2d byte arrays. One for the wind
x direction and another for the wind
y direction. The fire will then add an amount to the cells and each update will add the wind x and y to the piece of powder that is on that cell. This almost works but pushes the powder much to fast.
The difficulty in doing this is that the powder is on a grid while the wind could be going a variety of directions.
What is the most efficient way of doing this?