summaryrefslogtreecommitdiff
path: root/src/deathpart.c
diff options
context:
space:
mode:
authorkdx <kikoodx@paranoici.org>2023-03-18 23:40:10 +0100
committerkdx <kikoodx@paranoici.org>2023-03-18 23:41:16 +0100
commitb796e0bea418cc541257e17274b6fb14d4cb5ee8 (patch)
treed87ce38493e6af3e5c75a3171981310a20b46920 /src/deathpart.c
parent297ee77f926197504f8e0d7d6fcf0bf602cccd66 (diff)
downloadhyperultra-b796e0bea418cc541257e17274b6fb14d4cb5ee8.tar.gz
death particles
Diffstat (limited to 'src/deathpart.c')
-rw-r--r--src/deathpart.c29
1 files changed, 20 insertions, 9 deletions
diff --git a/src/deathpart.c b/src/deathpart.c
index e7a9dab..e08f25b 100644
--- a/src/deathpart.c
+++ b/src/deathpart.c
@@ -1,14 +1,25 @@
+#include "entity.h"
+#include "player.h"
#include "entityimpl.h"
+#include <stdlib.h>
-IMPL_UPDATE()
-}
+IMPL_UPDATE() {
+ this->vel[1] *= AIR_RESISTANCE;
+ this->vel[1] += GRAVITY;
+ entity_move(this, g);
+} IMPL_END
-IMPL_DRAW()
+IMPL_DRAW() {
LZY_DrawSetColor(BLACK);
- LZY_DrawRect(this->pos[0] - this->width / 2,
- this->pos[1] - this->height / 2,
- this->width, this->height);
-}
+ LZY_DrawRect(this->pos[0], this->pos[1], this->width, this->height);
+} IMPL_END
-IMPL_INIT(deathpart)
-}
+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->height = this->width = 1 + rand() % 2;
+} IMPL_END