summaryrefslogtreecommitdiff
path: root/src/elements/glow.c
diff options
context:
space:
mode:
authorjacksonmj <jacksonmj@jacksonmj.none>2011-01-07 16:18:22 (GMT)
committer jacksonmj <jacksonmj@jacksonmj.none>2011-01-07 16:18:22 (GMT)
commitf3ded5f08c0bbb3523a0ab2ee6e07538fabd79c2 (patch)
tree804bfff0e558daf780b4330db417e93e2ef695a2 /src/elements/glow.c
parentb661418d7ecd44960f0e24eb7abd79cfc5eb5f0e (diff)
downloadpowder-f3ded5f08c0bbb3523a0ab2ee6e07538fabd79c2.zip
powder-f3ded5f08c0bbb3523a0ab2ee6e07538fabd79c2.tar.gz
More function pointers.
Diffstat (limited to 'src/elements/glow.c')
-rw-r--r--src/elements/glow.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/elements/glow.c b/src/elements/glow.c
new file mode 100644
index 0000000..a4a1c57
--- /dev/null
+++ b/src/elements/glow.c
@@ -0,0 +1,21 @@
+#include <powder.h>
+
+int update_GLOW(UPDATE_FUNC_ARGS) {
+ int r;
+ for (nx=-1; nx<2; nx++)
+ for (ny=-1; ny<2; ny++)
+ if (x+nx>=0 && y+ny>0 && x+nx<XRES && y+ny<YRES && (nx || ny))
+ {
+ r = pmap[y+ny][x+nx];
+ if ((r>>8)>=NPART || !r)
+ continue;
+ if (parts[r>>8].type==PT_WATR&&5>(rand()%2000))
+ {
+ parts[i].type = PT_NONE;
+ parts[r>>8].type = PT_DEUT;
+ parts[r>>8].life = 10;
+ }
+ }
+
+ return 0;
+}