diff options
Diffstat (limited to 'src/elements/goo.cpp')
| -rw-r--r-- | src/elements/goo.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/elements/goo.cpp b/src/elements/goo.cpp new file mode 100644 index 0000000..c305182 --- /dev/null +++ b/src/elements/goo.cpp @@ -0,0 +1,13 @@ +#include "element.h" + +int update_GOO(UPDATE_FUNC_ARGS) { + if (!parts[i].life && sim->pv[y/CELL][x/CELL]>1.0f) + parts[i].life = rand()%80+300; + if (parts[i].life) + { + float advection = 0.1f; + parts[i].vx += advection*sim->vx[y/CELL][x/CELL]; + parts[i].vy += advection*sim->vy[y/CELL][x/CELL]; + } + return 0; +} |
