aboutsummaryrefslogtreecommitdiff
path: root/src/bullets.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/bullets.c')
-rw-r--r--src/bullets.c13
1 files changed, 13 insertions, 0 deletions
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;