2022-09-11 10:16:50 +00:00
|
|
|
namespace hr {
|
|
|
|
|
|
|
|
namespace ads_game {
|
|
|
|
|
|
|
|
/** simulation speed */
|
|
|
|
ld simspeed = TAU;
|
|
|
|
|
|
|
|
/** by how much do WAS keys accelerate */
|
|
|
|
ld accel = 6;
|
|
|
|
|
2022-09-17 13:16:04 +00:00
|
|
|
/** transform world coordinates to current view coordinates */
|
2022-09-11 10:16:50 +00:00
|
|
|
ads_matrix current;
|
|
|
|
|
2022-09-17 13:16:04 +00:00
|
|
|
/** transform world coordinates to ship coordinates (used when paused) */
|
|
|
|
ads_matrix current_ship;
|
|
|
|
|
|
|
|
/** SL cell closest to the current view/ship */
|
|
|
|
cell *vctr, *new_vctr, *vctr_ship;
|
2022-09-11 10:16:50 +00:00
|
|
|
|
|
|
|
/** world coordinates of vctr -- technically, this is a shiftmatrix */
|
2022-09-17 13:16:04 +00:00
|
|
|
ads_matrix vctrV, new_vctrV, vctrV_ship;
|
2022-09-11 10:16:50 +00:00
|
|
|
|
|
|
|
/** how far is vctr from the ship */
|
|
|
|
ld vctr_dist;
|
|
|
|
|
|
|
|
/** how is the ship shape rotated */
|
|
|
|
ld ang = 0;
|
|
|
|
|
|
|
|
/** ship's current proper time */
|
|
|
|
ld ship_pt;
|
|
|
|
|
2022-09-17 13:16:04 +00:00
|
|
|
/** paused camera's current proper time */
|
|
|
|
ld view_pt;
|
|
|
|
|
2022-09-12 10:57:52 +00:00
|
|
|
/** until when is the ship invincible */
|
|
|
|
ld invincibility_pt;
|
|
|
|
|
2022-09-11 10:16:50 +00:00
|
|
|
/** is the game paused */
|
|
|
|
bool paused;
|
|
|
|
|
|
|
|
/** auto-rotate the screen */
|
|
|
|
bool auto_rotate = false;
|
|
|
|
|
|
|
|
/** should we display the proper times of all objects */
|
|
|
|
bool view_proper_times = false;
|
|
|
|
|
|
|
|
/** format for displaying time */
|
|
|
|
const char *tformat = "%.2f";
|
|
|
|
|
|
|
|
void game_menu();
|
|
|
|
|
2022-09-11 11:42:51 +00:00
|
|
|
/** all the missiles and objects currently displayed */
|
2022-09-11 11:43:44 +00:00
|
|
|
vector<struct ads_object*> displayed;
|
2022-09-11 11:42:51 +00:00
|
|
|
|
|
|
|
color_t missile_color = 0xFF0000FF;
|
|
|
|
|
2022-09-12 10:57:52 +00:00
|
|
|
bool game_over;
|
|
|
|
|
2022-09-12 10:24:18 +00:00
|
|
|
struct player_data {
|
|
|
|
int hitpoints;
|
|
|
|
int score;
|
|
|
|
int ammo;
|
|
|
|
ld fuel;
|
|
|
|
ld oxygen;
|
|
|
|
};
|
|
|
|
|
2022-09-12 10:57:52 +00:00
|
|
|
ld how_much_invincibility = TAU / 4;
|
|
|
|
|
2022-09-12 10:24:18 +00:00
|
|
|
player_data pdata, max_pdata, tank_pdata;
|
|
|
|
|
2022-09-17 14:47:22 +00:00
|
|
|
bool auto_angle = true;
|
|
|
|
|
2022-09-11 10:16:50 +00:00
|
|
|
}}
|