summaryrefslogtreecommitdiff
path: root/src/game/player.h
diff options
context:
space:
mode:
authoraura <nw@moneybot.cc>2026-02-27 10:08:07 +0100
committeraura <nw@moneybot.cc>2026-02-27 10:08:07 +0100
commit66561ea2fb7f76c408c08e21132e58914329faba (patch)
treee02e5c7ff51563a35417bdfe70af568db53896f1 /src/game/player.h
parentb24f37279bcc4b3abd92b697eadcec1feba8d276 (diff)
more movement
Diffstat (limited to 'src/game/player.h')
-rw-r--r--src/game/player.h37
1 files changed, 28 insertions, 9 deletions
diff --git a/src/game/player.h b/src/game/player.h
index 7dfd009..27b423d 100644
--- a/src/game/player.h
+++ b/src/game/player.h
@@ -2,32 +2,51 @@
#include "object.h"
#include "camera.h"
+enum PlayerFlags_t {
+ PFL_NONE = 0,
+ PFL_ONGROUND = 1 << 0,
+ PFL_INVULNERABLE = 1 << 1,
+ PFL_NOCLIP = 1 << 2,
+ PFL_DUCK = 1 << 3,
+};
+
+enum PlayerMoveType_t {
+ PMT_NONE = 0,
+ PMT_WALK = 1,
+ PMT_FLY = 2,
+ PMT_LADDER = 3,
+ PMT_NOCLIP = 4
+};
+
struct PLAYER_INPUT {
PLAYER_CAMERA cam;
struct PLAYER* pobj;
// for nulls
U8 fwd_held{}, bk_held{}, left_held{}, right_held{};
+ U8 jump{};
VEC2 move;
};
struct PLAYER : OBJECT {
static const U32 CLASSID = OBJCLASS_PLAYER;
- U32 health;
- F32 fov{72.f};
- F32 eyeoffset{40.f};
+ OBJVAR( U32, health );
+ OBJVARV( F32, fov, 72.f );
+ OBJVARV( F32, eyeoffset, 40.f );
+
+ OBJVAR( I32, flags );
PLAYER_INPUT input;
- VEC3 mins;
- VEC3 maxs;
- F32 gravity{1.f};
- F32 maxspeed{70.f};
- F32 walkspeed{70.f};
+ OBJVARV( F32, gravity, 1.f );
+ F32 maxspeed{250.f};
+ F32 walkspeed{250.f};
F32 stepsize{16.f};
+ OBJVARV( U8, movetype, PMT_WALK );
- VEC3 velocity;
+ OBJECT* ground_ent;
+ F32 surf_friction{};
};
extern PLAYER* player_create( VEC3 origin, F32 yaw );