diff --git a/src/entity.h b/src/entity.h index 5e217734..fd885177 100644 --- a/src/entity.h +++ b/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 */ diff --git a/src/game.c b/src/game.c index 74e13b9c..b017d7e6 100644 --- a/src/game.c +++ b/src/game.c @@ -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; diff --git a/src/user.c b/src/user.c index 90005011..002bee59 100644 --- a/src/user.c +++ b/src/user.c @@ -996,13 +996,14 @@ 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) { - .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 - }); + /* Queue player fire 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 + }); + } } /* ---------------------------------------------------------------------- */