diff options
Diffstat (limited to 'src/deathpart.c')
-rw-r--r-- | src/deathpart.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/deathpart.c b/src/deathpart.c index bdc3cdf..3a94ac8 100644 --- a/src/deathpart.c +++ b/src/deathpart.c @@ -3,6 +3,16 @@ #include "entityimpl.h" #include <stdlib.h> +IMPL_INIT(deathpart) { + this->ignore_solids = true; + this->vel[0] = (float)(rand() % 1024) / 1024; + this->vel[1] = -(float)(rand() % 1024) / 512; + this->vel[0] *= this->vel[0]; + if (rand() % 2) + this->vel[0] *= -1; + this->width = 1 + rand() % 2; +} + IMPL(update) { if (this->deathpart.skip == 0) { this->vel[1] *= AIR_RESISTANCE; @@ -21,13 +31,3 @@ IMPL(draw) { (void)LZY_DrawRect(this->pos[0], this->pos[1], this->width, this->width); } - -IMPL_INIT(deathpart) { - this->ignore_solids = true; - this->vel[0] = (float)(rand() % 1024) / 1024; - this->vel[1] = -(float)(rand() % 1024) / 512; - this->vel[0] *= this->vel[0]; - if (rand() % 2) - this->vel[0] *= -1; - this->width = 1 + rand() % 2; -} IMPL_END |