tonk.h (605B)
1 #include <raylib.h> 2 #include <stdlib.h> 3 #include <stdio.h> 4 #include <math.h> 5 #include <string.h> 6 #include <sys/param.h> 7 #include <stdbool.h> 8 9 #define TANK_SPEED 100 10 #define TANK_ROT_SPEED 100 11 #define TANK_WIDTH 20 12 #define TANK_HEIGHT 50 13 #define GUN_WIDTH 5 14 #define GUN_HEIGHT 30 15 #define MAX_SHOTS 100 16 17 #define INDEG(rad) (rad * (180 / M_PI)) 18 #define CLAMP(val, lower, upper) ((val < lower) ? lower : ((val > upper) ? upper: val)) 19 20 typedef struct tank { 21 Vector2 pos; 22 float rot, gunrot; 23 } tank; 24 25 typedef struct shot { 26 Vector2 pos; 27 float speed, rot; 28 int bounces; 29 bool exists; 30 tank *shooter; 31 } shot;