summaryrefslogtreecommitdiff
path: root/kon/konworld.c
diff options
context:
space:
mode:
authorKonAki <konaki@anokonaki.org>2026-10-11 17:04:38 +0800
committerKonAki <konaki@anokonaki.org>2026-10-11 17:04:38 +0800
commit3ea9d25f9eb240b57e40434abade106add157a8d (patch)
tree0ea544033dec915f75c40a6d3d79a1241d80c7db /kon/konworld.c
parentcbde2ee49bf1a94ee38106ef229db89812538de4 (diff)
world: jumpSpeed per body, 0 turns jumping off
Diffstat (limited to 'kon/konworld.c')
-rw-r--r--kon/konworld.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/kon/konworld.c b/kon/konworld.c
index 1806099..be9d2c2 100644
--- a/kon/konworld.c
+++ b/kon/konworld.c
@@ -423,13 +423,15 @@ void kon_bodyInit(kon_body_t *body, float x, float y, float z, float radius, flo
body->height = height;
body->sector = -1;
body->touching = -1;
+ body->jumpSpeed = 6.0f;
}
-void kon_bodyJump(kon_body_t *body, float speed)
+int kon_bodyJump(kon_body_t *body)
{
- if (!body->onGround) return;
- body->vy = speed;
+ if (!body->onGround || body->jumpSpeed <= 0.0f) return 0;
+ body->vy = body->jumpSpeed;
body->onGround = 0;
+ return 1;
}
void kon_worldPlace(const kon_world_t *world, kon_body_t *body)