minor cleanup
This commit is contained in:
parent
1125015ff7
commit
d17727c133
20
src/entity.h
20
src/entity.h
@ -12,9 +12,6 @@ enum entity_prop {
|
||||
ENTITY_PROP_CAMERA,
|
||||
ENTITY_PROP_CAMERA_ACTIVE,
|
||||
|
||||
ENTITY_PROP_EQUIPPER,
|
||||
ENTITY_PROP_EQUIPABLE,
|
||||
|
||||
ENTITY_PROP_WEAPON,
|
||||
ENTITY_PROP_TRIGGERING_EQUIPPED,
|
||||
ENTITY_PROP_TRIGGERED_THIS_TICK,
|
||||
@ -81,15 +78,18 @@ struct entity {
|
||||
} control;
|
||||
|
||||
/* ====================================================================== */
|
||||
/* Physics */
|
||||
|
||||
struct v2 acceleration;
|
||||
struct v2 velocity;
|
||||
/* Player control */
|
||||
|
||||
/* ENTITY_PROP_PLAYER_CONTROLLED */
|
||||
f32 player_max_speed;
|
||||
f32 player_acceleration;
|
||||
|
||||
/* ====================================================================== */
|
||||
/* Physics */
|
||||
|
||||
struct v2 acceleration;
|
||||
struct v2 velocity;
|
||||
|
||||
/* ====================================================================== */
|
||||
/* Sprite */
|
||||
|
||||
@ -111,6 +111,12 @@ struct entity {
|
||||
|
||||
struct entity_handle equipped;
|
||||
|
||||
/* ====================================================================== */
|
||||
/* Weapon */
|
||||
|
||||
/* ENTITY_PROP_WEAPON */
|
||||
f32 fire_rate;
|
||||
|
||||
/* ====================================================================== */
|
||||
/* Testing */
|
||||
|
||||
|
||||
@ -124,7 +124,6 @@ INTERNAL void spawn_test_entities(void)
|
||||
e->control.focus = V2(0, -1);
|
||||
|
||||
entity_enable_prop(e, ENTITY_PROP_ANIMATING);
|
||||
entity_enable_prop(e, ENTITY_PROP_EQUIPPER);
|
||||
|
||||
player_ent = e;
|
||||
|
||||
@ -133,9 +132,9 @@ INTERNAL void spawn_test_entities(void)
|
||||
|
||||
/* Child 1 */
|
||||
{
|
||||
struct v2 pos = V2(1, -1);
|
||||
struct v2 pos = V2(0.25, -0.25);
|
||||
struct v2 size = V2(1, 1);
|
||||
f32 r = 0;
|
||||
f32 r = PI / 4;
|
||||
|
||||
struct xform xf = XFORM_TRS(.t = pos, .r = r, .s = size);
|
||||
|
||||
@ -145,7 +144,6 @@ INTERNAL void spawn_test_entities(void)
|
||||
e->sprite = sprite_tag_from_path(STR("res/graphics/gun.ase"));
|
||||
|
||||
entity_enable_prop(e, ENTITY_PROP_ANIMATING);
|
||||
entity_enable_prop(e, ENTITY_PROP_EQUIPABLE);
|
||||
entity_enable_prop(e, ENTITY_PROP_WEAPON);
|
||||
|
||||
player_ent->equipped = e->handle;
|
||||
|
||||
@ -996,14 +996,15 @@ INTERNAL void user_update(void)
|
||||
.move_dir = input_move_dir,
|
||||
.aim_pos = input_aim_pos
|
||||
});
|
||||
}
|
||||
|
||||
/* Queue player fire cmd */
|
||||
queue_game_cmd(&cmd_list, (struct game_cmd) {
|
||||
queue_game_cmd(&cmd_list, (struct game_cmd)
|
||||
{
|
||||
.kind = GAME_CMD_KIND_PLAYER_FIRE,
|
||||
.state = (G.bind_states[USER_BIND_KIND_FIRE].num_presses > 0 || G.bind_states[USER_BIND_KIND_FIRE].is_held) ? GAME_CMD_STATE_START : GAME_CMD_STATE_STOP
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
Loading…
Reference in New Issue
Block a user