summaryrefslogtreecommitdiff
path: root/src/elements
diff options
context:
space:
mode:
authorCate <cate@cate-6sh2.(none)>2011-07-12 14:37:45 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2011-07-12 16:43:17 (GMT)
commite17a2a0b031a92a6bdb77297e5c176addbca8a0f (patch)
tree5b0398e7716759968a065c96da75d702a5aba27d /src/elements
parent7480442c67682c40672dd862a921972e816ce59e (diff)
downloadpowder-e17a2a0b031a92a6bdb77297e5c176addbca8a0f.zip
powder-e17a2a0b031a92a6bdb77297e5c176addbca8a0f.tar.gz
Added blunt temperature controls to CLST that cause it to freeze in place when cooled by cohesion. Doesn't produce the exact same finger shapes as before for some arcane reason, I seriously have no clue why. But looks close enough for passing.
Diffstat (limited to 'src/elements')
-rw-r--r--src/elements/clst.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/elements/clst.c b/src/elements/clst.c
index db0eb7c..33e5686 100644
--- a/src/elements/clst.c
+++ b/src/elements/clst.c
@@ -2,6 +2,7 @@
int update_CLST(UPDATE_FUNC_ARGS) {
int r, rx, ry;
+ float cxy;
for (rx=-2; rx<3; rx++)
for (ry=-2; ry<3; ry++)
if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
@@ -16,7 +17,16 @@ int update_CLST(UPDATE_FUNC_ARGS) {
}
if ((r&0xFF)==PT_CLST)
{
- parts[i].vx += 0.01*rx; parts[i].vy += 0.01*ry;
+ if(parts[i].temp >= 0 && parts[i].temp <294)
+ cxy = 0.02;
+ if(parts[i].temp >= 295 && parts[i].temp <349)
+ cxy = 0.01;
+ if(parts[i].temp >= 250 && parts[i].temp <499)
+ cxy = 0.005;
+ if(parts[i].temp >= 500)
+ cxy = 0.001;
+ parts[i].vx += cxy*rx;
+ parts[i].vy += cxy*ry;
}
}
return 0;