diff options
Diffstat (limited to 'src/bullets.h')
-rw-r--r-- | src/bullets.h | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src/bullets.h b/src/bullets.h new file mode 100644 index 0000000..a01a967 --- /dev/null +++ b/src/bullets.h @@ -0,0 +1,34 @@ +#include "gameCommon.h" +#include "entity.h" + +#ifndef BULLET_H +#define BULLET_H + +// Just a simple, deadly, bullet. +typedef struct Bullet { + bool hit; + Ray ray; + EntityId fromId; + EntityFingerprint fromFingerprint; // Shooter gets shot before bullet hits object hehe. + float damage; +} Bullet; + +// All the simple, deadly, bullets. +typedef struct Bullets { + Bullet * bullets; + size_t bulletsCount; +} Bullets; + +// Create the simple, deadly, bullet. offset is the bullet offset from the entity. +Bullet createBullet(Entity entity, Vector3 direction, Vector3 offset, float damage); + +void initBullets(Bullets * bullets); +void freeBullets(Bullets * bullets); + +KfError addBullet(Bullets * bullets, Bullet bullet); +KfError popBackBullets(Bullets * bullets); + +void updateBullets(Game * game, Bullets * bullets); +void updateBullet(Game * game, Bullet * bullet); + +#endif |