A physicist could come up with an elaborate model for simulating smoke that produces results indistinguishable from real smoke. We are interested in simple models, with successive refinement.
Our first version of smoke introduces the idea of gradual fading by painting the screen with a translucent black. We do this by painting the screen with a call to
rect using a fill color of black, but with a low alpha value to provide transparency.
This gives us something to critique. The smoke is stationary, and it does not disperse. We fix this at the cost of complexity. By adding a class
SmokePuff, we can create puffs of smoke that drift across the screen while expanding and fading.