From fc6e0037a2f0769fdbd4c18bd96f49d55f630757 Mon Sep 17 00:00:00 2001 From: nathansmithsmith Date: Sun, 30 Jul 2023 23:51:37 -0600 Subject: Started caporale circling thingy --- src/bullets.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/bullets.c') diff --git a/src/bullets.c b/src/bullets.c index 1619111..ec5908f 100644 --- a/src/bullets.c +++ b/src/bullets.c @@ -43,3 +43,16 @@ BulletHitInfo shootBullet(World * world, Bullet bullet) { .hitId = ENTITY_NONE, }; } + +BulletHitInfo shootBulletAtEntity(Entity * entity, Bullet bullet) { + RayCollision collision = traceRayToEntity(*entity, bullet.ray); + + if (collision.hit) + return handleBulletHit(entity, bullet); + + return (BulletHitInfo){ + .hit = false, + .killed = false, + .hitId = ENTITY_NONE, + }; +} -- cgit v1.2.3