From de29b11a88dbdd3af0824e59b51528b91ee73c54 Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Thu, 30 Nov 2017 22:49:38 +0100 Subject: First commit. Version works on Linux (keyboard only, not configurable) --- src/weapon.h | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 src/weapon.h (limited to 'src/weapon.h') diff --git a/src/weapon.h b/src/weapon.h new file mode 100644 index 0000000..5f47be6 --- /dev/null +++ b/src/weapon.h @@ -0,0 +1,34 @@ +#ifndef WEAPON_H +#define WEAPON_H + +#include "collision.h" + +#define ARROW 0 +#define AXE 1 +#define BOOMERANG 2 +#define FIREBALL 3 +#define BOMB 4 +#define SWORD 5 + +typedef struct { + int id, type; + + double x, y; + double vsp, hsp; + double grav; + double imageIndex; + int dir; + + int power, timer, state, cooldown, hitflag; + + Mask weaponMask; +} Weapon; + +void addWeapon(int type, int x, int y); +void weaponStep(Weapon* w); +void weaponDraw(Weapon* w); + +void weaponHit(Weapon* w); +void weaponDestroy(int id); + +#endif \ No newline at end of file -- cgit v1.2.3