aboutsummaryrefslogtreecommitdiff
path: root/src/weapon.h
blob: 5f47be6b9224e31d0ad24ad78a72457c49445ae2 (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
33
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