X-Git-Url: http://deadsoftware.ru/gitweb?a=blobdiff_plain;f=game.h;h=a2d44b4ba1c82167c55681235148d7efb884c098;hb=0aebaa861295894d8bfd51ee7d02da0d4b63e477;hp=7bf9d1e5621aa8838cb760bb39e4e0df0e54820e;hpb=4148d3ff0c0c4b52b0741c38a867a1502600a65f;p=netwar.git diff --git a/game.h b/game.h index 7bf9d1e..a2d44b4 100644 --- a/game.h +++ b/game.h @@ -2,17 +2,19 @@ #include "protocol.h" -#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 +#define MAX_PLAYERS 32 +#define MAX_BULLETS (MAX_PLAYERS * 8) +#define TICK_DELAY (1000 / 20) // 20 World updates per second +#define BULLET_TIME (TICK_DELAY * 6) // Bullet live time 6.0s +#define PLAYER_SIZE 0.01785 // Palyer radius +#define PLAYER_SHOOT (TICK_DELAY * 0.3) // Can shoot every 0.15s typedef struct Player { /* public */ bool live; float x, y, r; float vx, vy, vr; + int shoot; /* internal */ bool updated; @@ -33,7 +35,8 @@ typedef struct 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_player_set(unsigned int id, bool live, float x, float y, float r, float vx, float vy, float vr, int shoot); 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_player_does(unsigned int id, DoesBits code); void g_update(); +void g_init(bool server_mode);