62 lines
919 B
C
Executable File
62 lines
919 B
C
Executable File
#ifndef WINGS
|
|
#define WINGS
|
|
|
|
#define MAX_MISSILES 4
|
|
|
|
// direction management
|
|
typedef struct Direction
|
|
{
|
|
char dx;
|
|
char dy;
|
|
} Direction;
|
|
|
|
// missiles management
|
|
typedef struct Missile
|
|
{
|
|
short x;
|
|
short y;
|
|
Direction dir;
|
|
// short distance; // distance between the plane and the missile
|
|
unsigned char type;
|
|
} Missile;
|
|
|
|
// 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;
|
|
|
|
Missile missiles[MAX_MISSILES];
|
|
// align
|
|
} Plane;
|
|
|
|
typedef struct Cloud
|
|
{
|
|
short x;
|
|
short y;
|
|
} Cloud;
|
|
|
|
typedef struct Dir_t
|
|
{
|
|
Direction map_dir;
|
|
Direction dir_requested;
|
|
} Dir_t;
|
|
|
|
int menu(void);
|
|
void init(void);
|
|
void update_frame(Dir_t *way);
|
|
int game(void);
|
|
|
|
#endif
|