From f98e6d4ea4ee52b298a7d9a9731da4c020bb4dfe Mon Sep 17 00:00:00 2001 From: nathansmithsmith Date: Fri, 18 Aug 2023 00:18:53 -0600 Subject: Some aim 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 ec5908f..bd7fc81 100644 --- a/src/bullets.c +++ b/src/bullets.c @@ -13,6 +13,19 @@ Bullet createBulletFromEntity(Entity entity, float damage) { }; } + +Bullet createBulletFromDirection(Entity entity, Vector3 direction, float damage) { + return (Bullet){ + .ray = (Ray){ + entity.position, + direction + }, + .fromId = entity.id, + .fromFingerprint = entity.fingerprint, + .damage = damage + }; +} + BulletHitInfo handleBulletHit(Entity * entity, Bullet bullet) { // Handle health. entity->health -= bullet.damage; -- cgit v1.2.3