#define OLC_PGE_APPLICATION #include "pixelGameEngine.h" #include "Smoke.h" using namespace olc; class Example : public PixelGameEngine { public: std::vector smokeParticles; float lastCreationTime=0; Example() { sAppName = "Example"; } public: float range(float low, float high) { return rand()%10000/10000.f*(high-low)+(low); } bool OnUserCreate() override { // Called once at the start, so create things here int smokeCount=200; int RANDOM_SPREAD_VAL=10; //Spread out between this amount; for (int i=0;i0.2) { for (int i=0;i<10;i++) { smokeParticles.push_back( /*Size*/{{5,range(2,5)}, /*Position*/{range(175,225) , range(100,102)} ,/*Rise Speed*/range(1,2.5),/*Fade Speed*/range(30,50)}); } lastCreationTime-=0.2; } return true; } }; int main() { Example demo; if (demo.Construct(256, 240, 4, 4)) demo.Start(); return 0; }