diff options
| author | Bryan Hoyle <starfoxprime@gmail.com> | 2011-08-16 18:39:50 (GMT) |
|---|---|---|
| committer | Bryan Hoyle <starfoxprime@gmail.com> | 2011-08-16 18:39:50 (GMT) |
| commit | e55e52c4604cafcfadde2ac7a1d893631f321871 (patch) | |
| tree | cb851246e8b10959b33f86356140d8807080af38 /src/elements | |
| parent | e7ce51d420d30ee6ab82df8e7dbbe791401f33e9 (diff) | |
| download | powder-e55e52c4604cafcfadde2ac7a1d893631f321871.zip powder-e55e52c4604cafcfadde2ac7a1d893631f321871.tar.gz | |
added gbmb which is an element that makes large amounts of gravity when it hits a particle
Diffstat (limited to 'src/elements')
| -rw-r--r-- | src/elements/gbmb.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/elements/gbmb.c b/src/elements/gbmb.c new file mode 100644 index 0000000..20582af --- /dev/null +++ b/src/elements/gbmb.c @@ -0,0 +1,20 @@ +#include <element.h> +int update_GBMB(UPDATE_FUNC_ARGS) { + int rx,ry,r; + for (rx=-2; rx<3; rx++) + for (ry=-2; ry<3; ry++){ + r = pmap[y+ry][x+rx]; + if(r) + if((r&0xFF)!=PT_BOMB&& + (r&0xFF)!=PT_GBMB&& + (r&0xFF)!=PT_CLNE&& + (r&0xFF)!=PT_PCLN&& + !parts[i].tmp){ + parts[i].life=100; + parts[i].tmp = 1; + } + } + if(parts[i].life>1) + gravmap[y/CELL][x/CELL] = -20; +return 0; +} |
