X-Git-Url: https://deadsoftware.ru/gitweb?p=netwar.git;a=blobdiff_plain;f=game.h;h=7bf9d1e5621aa8838cb760bb39e4e0df0e54820e;hp=17c2b68dfafec9a26463c9db8624a2fd732069c9;hb=4148d3ff0c0c4b52b0741c38a867a1502600a65f;hpb=c4b04d12861ae0eac6315b1c2170013422136f80 diff --git a/game.h b/game.h index 17c2b68..7bf9d1e 100644 --- a/game.h +++ b/game.h @@ -2,8 +2,10 @@ #include "protocol.h" -#define MAX_PLAYERS 64 -#define TICK_DELAY (1000 / 60) +#define MAX_PLAYERS 32 +#define MAX_BULLETS (MAX_PLAYERS * 8) +#define TICK_DELAY (1000 / 30) +#define BULLET_TIME (TICK_DELAY * 6) #define PLAYER_SIZE 0.01785 typedef struct Player { @@ -16,8 +18,22 @@ typedef struct Player { bool updated; } Player; +typedef struct Bullet { + /* public */ + bool live; + int owner; + float x, y; + float vx, vy; + int tick; + + /* internal */ + bool updated; +} Bullet; + extern Player g_player[MAX_PLAYERS]; +extern Bullet g_bullet[MAX_BULLETS]; void g_player_set(unsigned int id, bool live, float x, float y, float r, float vx, float vy, float vr); +void g_bullet_set(unsigned int id, unsigned int owner, bool live, float x, float y, float vx, float vy, int tick); void g_player_does(unsigned int id, DoesCode code); void g_update();