2017-04-17 16:55:21 +02:00
|
|
|
#ifndef WINGS
|
|
|
|
#define WINGS
|
|
|
|
|
2017-04-30 18:37:55 +02:00
|
|
|
#define MAX_MISSILES 4
|
2017-04-20 12:44:09 +02:00
|
|
|
|
2017-07-30 15:20:33 +02:00
|
|
|
// direction management
|
|
|
|
typedef struct Direction
|
|
|
|
{
|
|
|
|
char dx;
|
|
|
|
char dy;
|
|
|
|
} Direction;
|
|
|
|
|
2017-04-20 22:25:52 +02:00
|
|
|
// missiles management
|
2017-04-19 22:43:18 +02:00
|
|
|
typedef struct Missile
|
|
|
|
{
|
2017-04-30 18:37:55 +02:00
|
|
|
short x;
|
|
|
|
short y;
|
2017-07-30 15:20:33 +02:00
|
|
|
Direction dir;
|
2017-04-30 18:37:55 +02:00
|
|
|
// short distance; // distance between the plane and the missile
|
2017-04-21 22:32:40 +02:00
|
|
|
unsigned char type;
|
2017-04-19 22:43:18 +02:00
|
|
|
} Missile;
|
|
|
|
|
2017-04-20 22:25:52 +02:00
|
|
|
// plane management
|
2017-04-19 20:30:58 +02:00
|
|
|
typedef struct Plane
|
|
|
|
{
|
|
|
|
short x;
|
|
|
|
short y;
|
2017-04-19 22:43:18 +02:00
|
|
|
|
2017-07-30 15:20:33 +02:00
|
|
|
Direction dir;
|
|
|
|
// (dx, dy)
|
2017-04-19 22:43:18 +02:00
|
|
|
/* plane direction management
|
2017-07-30 15:20:33 +02:00
|
|
|
(1, 1) (0, 1) (-1, 1)
|
|
|
|
(1, 0) plane (-1, 0)
|
|
|
|
(1,-1) (0,-1) (-1,-1)
|
2017-04-19 22:43:18 +02:00
|
|
|
*/
|
|
|
|
|
2017-04-19 20:30:58 +02:00
|
|
|
unsigned char life;
|
2017-07-30 15:20:33 +02:00
|
|
|
unsigned char bullets;
|
2017-04-19 22:43:18 +02:00
|
|
|
|
2017-04-21 22:32:40 +02:00
|
|
|
Missile missiles[MAX_MISSILES];
|
2017-04-19 20:30:58 +02:00
|
|
|
// align
|
|
|
|
} Plane;
|
|
|
|
|
2017-04-30 18:09:11 +02:00
|
|
|
typedef struct Cloud
|
|
|
|
{
|
|
|
|
short x;
|
|
|
|
short y;
|
|
|
|
} Cloud;
|
|
|
|
|
2017-04-20 22:25:52 +02:00
|
|
|
int menu(void);
|
|
|
|
void init(void);
|
2017-07-30 15:20:33 +02:00
|
|
|
void *update_frame(Direction *direction);
|
2017-04-20 22:25:52 +02:00
|
|
|
int game(void);
|
2017-04-19 22:43:18 +02:00
|
|
|
|
2017-04-17 16:55:21 +02:00
|
|
|
#endif
|