From 9588ded8d76e720299ad9d1b254409e715164b81 Mon Sep 17 00:00:00 2001 From: nathansmithsmith Date: Fri, 10 Nov 2023 12:19:50 -0700 Subject: Making changes to the guns and fine tuning --- src/entities/soldato.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/entities/soldato.c') diff --git a/src/entities/soldato.c b/src/entities/soldato.c index 3f548ac..7318d5b 100644 --- a/src/entities/soldato.c +++ b/src/entities/soldato.c @@ -119,14 +119,12 @@ void updateSoldatoGuns(Game * game, Entity * entity) { if (t - data->timeSinceLastShot < SOLDATO_COOLDOWN) return; - // Shoot if in range. - if (Vector3Distance(entity->position, player->position) <= SOLDATO_GUN_MAX_RANGE) { - Bullet bullet = createBulletFromDirection(*entity, data->gunTarget, SOLDATO_BULLET_DAMAGE); - BulletHitInfo hit = shootBulletAtEntity(player, bullet); + // Shoot this fucker. + Bullet bullet = createBulletFromDirection(*entity, data->gunTarget, SOLDATO_BULLET_DAMAGE); + BulletHitInfo hit = shootBulletAtEntity(player, bullet); - if (hit.hit) - printf("This fucker hit %lf\n", t); - } + if (hit.hit) + printf("This fucker hit %lf\n", t); data->timeSinceLastShot = t; } @@ -154,12 +152,14 @@ void drawSoldato(Game * game, Entity * entity) { entityDraw(entity); // Debug gun. + /* Soldato * data = (Soldato*)entity->data; DrawLine3D( entity->position, Vector3Add(entity->position, Vector3Scale(data->gunTarget, SOLDATO_GUN_MAX_RANGE)), BLUE ); + */ /* Entity * leader; -- cgit v1.2.3