DEADSOFTWARE

Добавлена стрельба
[netwar.git] / game.h
1 #include <stdbool.h>
3 #include "protocol.h"
5 #define MAX_PLAYERS 32
6 #define MAX_BULLETS (MAX_PLAYERS * 8)
7 #define TICK_DELAY (1000 / 30)
8 #define BULLET_TIME (TICK_DELAY * 6)
9 #define PLAYER_SIZE 0.01785
11 typedef struct Player {
12 /* public */
13 bool live;
14 float x, y, r;
15 float vx, vy, vr;
17 /* internal */
18 bool updated;
19 } Player;
21 typedef struct Bullet {
22 /* public */
23 bool live;
24 int owner;
25 float x, y;
26 float vx, vy;
27 int tick;
29 /* internal */
30 bool updated;
31 } Bullet;
33 extern Player g_player[MAX_PLAYERS];
34 extern Bullet g_bullet[MAX_BULLETS];
36 void g_player_set(unsigned int id, bool live, float x, float y, float r, float vx, float vy, float vr);
37 void g_bullet_set(unsigned int id, unsigned int owner, bool live, float x, float y, float vx, float vy, int tick);
38 void g_player_does(unsigned int id, DoesCode code);
39 void g_update();