No this is like watching a fire burn.
Code:
#define RGBTODWORD (r,g,b) ((r<<16)+(g<<8)+(b))
RGB fire[30][100];
void AddHeat(int heatvalue)
{
int x=rand() % 30;
int y=rand()%100;
fire[x][y]+=heatvalue;
fire[x][y]&=0xFF;
}
void DrawFire(int x,int y)
{
int row=0,col=0;
for (int i=x;i<x+30,i++)
{
for (int j=y;j<y+100;j++)
{
int heat=fire[col][row];
if (heat>30)
{
float coef=heat/255.0;
DWORD firecolor=RGBTODWORD(coef*255,0,0);
PlotPixel32(i,j,firecolor);
}
row++
}
col++;
row=0;
}
}
void UpdateFire(int cooldownfactor)
{
for (int i=0;i<30;i++)
{
for (int j=98;j>0;j--)
{
int heat=fire[i][j+1];
heat-=cooldownfactor;
if (heat<0) heat=0;
fire[i][j]=heat;
}
}
}
Just add main and a loop for your fire and watch to see what happens....that is, if I didn't make any mistakes.