aboutsummaryrefslogtreecommitdiff
path: root/src/weapon.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/weapon.h')
-rw-r--r--src/weapon.h34
1 files changed, 34 insertions, 0 deletions
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