time_unit and pause_speed settings

This commit is contained in:
Zeno Rogue 2022-09-18 10:22:13 +02:00
parent 11b70006aa
commit 6ea3cc4bcc
3 changed files with 13 additions and 5 deletions

View File

@ -164,7 +164,7 @@ bool ads_turn(int idelta) {
}
if(paused && a[16+11]) {
current = ads_matrix(spin(ang*degree) * xpush(mul*delta*-5) * spin(-ang*degree), 0) * current;
current = ads_matrix(spin(ang*degree) * xpush(mul*delta*-pause_speed) * spin(-ang*degree), 0) * current;
}
else
apply_lorentz(spin(ang*degree) * lorentz(0, 2, -delta*accel*mul) * spin(-ang*degree));

View File

@ -88,7 +88,7 @@ void draw_game_cell(cell *cs, ads_matrix V, ld plev) {
}
if(view_proper_times) {
string str = format(tformat, center.shift / TAU);
string str = format(tformat, center.shift / time_unit);
queuestr(shiftless(rgpushxto0(center.h)), .1, str, 0xFF4040, 8);
}
@ -122,7 +122,7 @@ void draw_game_cell(cell *cs, ads_matrix V, ld plev) {
0x000000FF, rock.col, PPR::LINE);
if(view_proper_times && rock.type != oParticle) {
string str = format(tformat, rock.pt_main.shift / TAU);
string str = format(tformat, rock.pt_main.shift / time_unit);
queuestr(shiftless(rgpushxto0(rock.pt_main.h)), .1, str, 0xFFFFFF, 8);
}
}
@ -243,13 +243,13 @@ void view_ads_game() {
poly_outline = 0xFF;
if(view_proper_times) {
string str = format(tformat, ship_pt / TAU);
string str = format(tformat, ship_pt / time_unit);
queuestr(shiftless(Id), .1, str, 0xFFFFFF, 8);
}
}
if(paused && view_proper_times) {
string str = format(tformat, view_pt / TAU);
string str = format(tformat, view_pt / time_unit);
queuestr(shiftless(Id), .1, str, 0xFFFF00, 8);
}
}

View File

@ -8,6 +8,12 @@ ld simspeed = TAU;
/** by how much do WAS keys accelerate */
ld accel = 6;
/** cursor movement speed while paused */
ld pause_speed = 5;
/** time unit for time display */
ld time_unit = TAU;
/** transform world coordinates to current view coordinates */
ads_matrix current;
@ -70,4 +76,6 @@ player_data pdata, max_pdata, tank_pdata;
bool auto_angle = true;
cell *starting_point;
}}