wings/include/wings.h

81 lines
1.2 KiB
C
Executable File

#ifndef WINGS
#define WINGS
#define MAX_CHARGE 40
#define MAX_PLANES 7
#define MAX_CLOUDS 15
#define MAX_WEAPON 3
#define MAP_SIZE_X 256
#define MAP_SIZE_Y 256
// direction management
typedef struct Direction
{
char dx;
char dy;
} Direction;
// Arms management
typedef struct Firearm
{
short x;
short y;
Direction dir;
char useful;
// short distance; // distance between the plane and the missile
} Firearm;
// plane management
typedef struct Plane
{
short x;
short y;
Direction dir;
// (dx, dy)
/* plane direction management
(1, 1) (0, 1) (-1, 1)
(1, 0) plane (-1, 0)
(1,-1) (0,-1) (-1,-1)
*/
unsigned char life;
unsigned char bullets_nb;
unsigned char bullets_type;
// 0 : missiles
// 1 : lightning
Firearm firearm[MAX_CHARGE];
// align
} Plane;
typedef struct Cloud
{
short x;
short y;
} Cloud;
//for timer callback
typedef struct FTCb
{
Direction map_dir;
Direction dir_requested;
unsigned char max_charge;
} FTCb;
typedef struct Weapon
{
short x;
short y;
char dy;
char type;
} Weapon;
int menu(void);
void init(void);
void update_frame(FTCb *info);
int game(void);
#endif