DEADSOFTWARE

Добавлена стрельба
[netwar.git] / game.h
diff --git a/game.h b/game.h
index 17c2b68dfafec9a26463c9db8624a2fd732069c9..7bf9d1e5621aa8838cb760bb39e4e0df0e54820e 100644 (file)
--- 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();