diff options
| author | jacksonmj <jacksonmj@jacksonmj.none> | 2011-01-08 00:07:10 (GMT) |
|---|---|---|
| committer | jacksonmj <jacksonmj@jacksonmj.none> | 2011-01-08 09:00:59 (GMT) |
| commit | d17758cc08080fcb3ab0b709ed74c5739d707894 (patch) | |
| tree | ffef6471b42f6eefeca052482f4660be8a85313e /src/elements/bcln.c | |
| parent | 9af0072b21409d71e04652330118a44e37c3f6c4 (diff) | |
| download | powder-d17758cc08080fcb3ab0b709ed74c5739d707894.zip powder-d17758cc08080fcb3ab0b709ed74c5739d707894.tar.gz | |
Yet more function pointers.
Diffstat (limited to 'src/elements/bcln.c')
| -rw-r--r-- | src/elements/bcln.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/elements/bcln.c b/src/elements/bcln.c index 41418cf..e27478d 100644 --- a/src/elements/bcln.c +++ b/src/elements/bcln.c @@ -1,6 +1,16 @@ #include <powder.h> int update_BCLN(UPDATE_FUNC_ARGS) { + if (!parts[i].life) + { + if (pv[y/CELL][x/CELL]>4.0f) + { + float advection = 0.1f; + parts[i].vx += advection*vx[y/CELL][x/CELL]; + parts[i].vy += advection*vy[y/CELL][x/CELL]; + parts[i].life = rand()%40+80; + } + } if (!parts[i].ctype) { for (nx=-1; nx<2; nx++) |
