-florian66-

Yo

Apr 21st, 2017
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.61 KB | None | 0 0
  1. #define MAX_MISSILES 4
  2. #define MAX_PLANES 2
  3.  
  4. typedef struct Missile
  5. {
  6.     unsigned char dir;
  7.     unsigned short distance; // distance between the plane and the missile
  8.     unsigned char type;
  9. } Missile;
  10.  
  11. // plane management
  12. typedef struct Plane
  13. {
  14.     int x;
  15.     int y;
  16.  
  17.         /* plane direction management
  18.         3      2     1
  19.         4    plane   0
  20.         5      6     7
  21.         */
  22.  
  23.     unsigned char dir;
  24.     unsigned char life;
  25.  
  26.     Missile missiles[MAX_MISSILES];
  27.     // align
  28. } Plane;
  29.  
  30. Plane planes[MAX_PLANES];
  31.  
  32. /*
  33. accés :
  34. int i = 0; j = 0;
  35. planes[i].missiles[j].dir ?
  36. */
Advertisement
Add Comment
Please, Sign In to add comment