aboutsummaryrefslogtreecommitdiff
path: root/src/bullets.h
blob: fea796114ceeb92f7be2be88edb7027248ebea62 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include "gameCommon.h"
#include "entity.h"
#include "world.h"

#ifndef BULLET_H
#define BULLET_H

// Just a simple, deadly, bullet.
typedef struct Bullet {
	Ray ray;
	EntityId fromId;
	EntityFingerprint fromFingerprint;
	float damage;
} Bullet;

typedef struct BulletHitInfo {
	bool hit;
	bool killed;
	EntityId hitId;
	EntityFingerprint hitFingerprint;
} BulletHitInfo;

// Uses entity postion and direction to create bullet ray.
Bullet createBulletFromEntity(Entity entity, float damage);

// Shoot this fucker.
BulletHitInfo shootBullet(World * world, Bullet bullet);

// Shott this fucker but only at one entity.
BulletHitInfo shootBulletAtEntity(Entity * entity, Bullet bullet);

#endif