DEADSOFTWARE

Фикс стрельбы
[netwar.git] / game.h
diff --git a/game.h b/game.h
index 44bad6348d2dfe74d980270ad03bd066bba26473..ea505cf3692fa27fa172a184e2b5c2145b4852c6 100644 (file)
--- a/game.h
+++ b/game.h
@@ -2,17 +2,20 @@
 
 #include "protocol.h"
 
-#define MAX_PLAYERS 32
-#define MAX_BULLETS (MAX_PLAYERS * 8)
-#define TICK_DELAY  (1000 / 40)
-#define BULLET_TIME (TICK_DELAY * 6)
-#define PLAYER_SIZE 0.01785
+#define MAX_PLAYERS  32
+#define MAX_BULLETS  (MAX_PLAYERS * 8)
+#define TICK         24                  // Количество обновлений мира в секунду
+#define TICK_DELAY   (1000 / TICK)       // Задержка между тиками
+#define BULLET_TIME  (TICK * 6)          // Время жизни игрока
+#define PLAYER_SIZE  0.01785             // Радиус игрока
+#define PLAYER_SHOOT ((int)(TICK * 0.8)) // Задержка между выстрелами
 
 typedef struct Player {
        /* public */
        bool  live;
        float x, y, r;
        float vx, vy, vr;
+       int   shoot;
 
        /* internal */
        bool  updated;
@@ -33,7 +36,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, DoesBits code);
 void g_update();
+void g_init(bool server_mode);