The-Powder-Toy/elements/goo.cpp
Simon Robertshaw b0ea52690b Initial
2012-01-08 17:39:03 +00:00

14 lines
312 B
C++

#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;
}