summaryrefslogtreecommitdiff
path: root/kon/konworld.h
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.h
parentcbde2ee49bf1a94ee38106ef229db89812538de4 (diff)
world: jumpSpeed per body, 0 turns jumping off
Diffstat (limited to 'kon/konworld.h')
-rw-r--r--kon/konworld.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/kon/konworld.h b/kon/konworld.h
index 4be1d1c..bce5187 100644
--- a/kon/konworld.h
+++ b/kon/konworld.h
@@ -85,6 +85,7 @@ typedef struct kon_body {
kon_vec3_t position;
float radius, height; /* 0.2 and 1.0 are fine for a person in this scale */
float vy; /* up speed, only jumps and falls change it */
+ float jumpSpeed; /* how fast a jump starts, 6 is about a metre. 0 turns jumping off for this body, like in a doom-style game */
int onGround;
int sector; /* the room it is in, -1 if none, kept up to date by kon_worldMove */
int touching; /* the collider it was pushed by in the last move, -1 if none. a monster hitting a door, say */
@@ -109,7 +110,8 @@ float kon_worldGround(const kon_world_t *world, float x, float z, float feet, in
/*** bodies ***/
void kon_bodyInit(kon_body_t *body, float x, float y, float z, float radius, float height);
-void kon_bodyJump(kon_body_t *body, float speed);
+/* does nothing in the air or when jumpSpeed is 0. returns 1 if it jumped */
+int kon_bodyJump(kon_body_t *body);
/* puts the feet on the ground under them right away */
void kon_worldPlace(const kon_world_t *world, kon_body_t *body);