summaryrefslogtreecommitdiff
path: root/src/powder.c
diff options
context:
space:
mode:
authorPhilip <philip@philip-linuxlaptop.(none)>2010-11-10 21:33:44 (GMT)
committer Philip <philip@philip-linuxlaptop.(none)>2010-11-10 21:33:44 (GMT)
commite47c60c07a942aad222f49ac895931807c77f7cc (patch)
tree5d803917ad620c7b6568dc1b50a14285c87e5b9b /src/powder.c
parentbd8a9f49313839cee94513f6c3059fdbdf824dda (diff)
downloadpowder-e47c60c07a942aad222f49ac895931807c77f7cc.zip
powder-e47c60c07a942aad222f49ac895931807c77f7cc.tar.gz
CRAC has real diffusion and gets darker with more water. you can see the water moving around.
Diffstat (limited to 'src/powder.c')
-rw-r--r--src/powder.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/powder.c b/src/powder.c
index 9a166ca..bb891c4 100644
--- a/src/powder.c
+++ b/src/powder.c
@@ -1892,7 +1892,7 @@ void update_particles_i(pixel *vid, int start, int inc)
r = pmap[y+ny][x+nx];
if(parts[r>>8].type==PT_WATR&&5>=rand()%100)
{
- parts[i].tmp++;
+ parts[i].life++;
parts[r>>8].type=PT_NONE;
}
}
@@ -1904,22 +1904,22 @@ void update_particles_i(pixel *vid, int start, int inc)
x+nx<XRES && y+ny<YRES && (nx || ny))
{
r = pmap[y+ny][x+nx];
- if(((r>>8)>=NPART || !r )&&parts[i].tmp>=1)//if nothing then create water
+ if(((r>>8)>=NPART || !r )&&parts[i].life>=1)//if nothing then create water
{
create_part(-1,x+nx,y+ny,PT_WATR);
- parts[i].tmp --;
+ parts[i].life --;
}
}
- for(nx=-1; nx<2; nx++)
- for(ny=-1; ny<2; ny++)
+ nx = rand()%5-2;
+ ny = rand()%5-2;
if(x+nx>=0 && y+ny>0 &&
x+nx<XRES && y+ny<YRES && (nx || ny))
{
r = pmap[y+ny][x+nx];
- if(parts[r>>8].type==t&&(parts[i].tmp>parts[r>>8].tmp)&&5>=rand()%50&&parts[i].tmp>0)//diffusion
+ if(parts[r>>8].type==t&&(parts[i].life>parts[r>>8].life)&&parts[i].life>0)//diffusion
{
- parts[r>>8].tmp ++;
- parts[i].tmp --;
+ parts[r>>8].life ++;
+ parts[i].life --;
}
}
}