| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- #ifndef STRUCT_H
- #define STRUCT_H
- //constants
- #define PI 3.14159265
- #define SIN_60 0.866025404
- #define COS_60 0.5
- #define true 1
- #define false 0
- #define bool unsigned char
- //macros
- #define abs(x) x>0 ? x : -x
- typedef struct Camera Camera;
- typedef struct Wall Wall;
- typedef struct Line Line;
- //the camera is defined by its center
- // ! and not by its upper left corner !
- //and an angle
- struct Camera{
- int cX;
- int cY;
- int angle;
- };
- //a simple obstacle structure
- //d is the distance from the lowest face of the trapeze to the center of the screen
- //h is the thickness of the wall
- //line indicates the line that contains this obstacle
- //id is self explanatory
- //nxt is used by the linked list
- struct Wall{
- int d;
- int h;
- int id;
- int line;
- Wall *nxt;
- };
- //a line. There are six lines (by default) in the game, numeroted from 0 to 5
- //each list has a list of obstacles and an angle
- struct Line{
- int id;
- Wall *list;
- int angle;
- };
- #endif
|