1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-11-27 14:37:16 +00:00

racing:: race_advance

This commit is contained in:
Zeno Rogue 2018-12-23 14:01:07 +01:00
parent 39067a83df
commit 8635c49a5e

View File

@ -15,6 +15,8 @@ bool track_ready;
int TWIDTH;
ld race_advance = 0;
static const int LENGTH = 250;
static const int DROP = 1;
@ -618,6 +620,7 @@ void set_view() {
hyperpoint h = T * inverse(T1) * at * C0;
ld y = asin_auto(h[1]);
ld x = asin_auto(h[0] / cos_auto(y));
x += race_advance;
// printf("%d %lf\n", z, x);
transmatrix Z = T1 * inverse(T) * xpush(x);
View = spin(race_angle * degree) * inverse(Z) * View;
@ -850,13 +853,16 @@ struct race_configurer {
case mdDisk:
pmodel = mdBand;
conformal::model_orientation = race_angle;
race_advance = 1;
break;
case mdBand:
pmodel = mdHalfplane;
conformal::model_orientation = race_angle + 90;
race_advance = 0.5;
break;
default:
pmodel = mdDisk;
race_advance = 0;
}
});
@ -866,6 +872,11 @@ struct race_configurer {
int q = conformal::model_orientation - race_angle;
dialog::reaction = [q] () { conformal::model_orientation = race_angle + q; };
});
dialog::addSelItem(XLAT("race advance"), fts(race_advance), 'A');
dialog::add_action([] () {
dialog::editNumber(race_advance, 0, 360, 0.1, 1, XLAT("race advance"), "");
});
dialog::addItem(shmup::player_count_name(playercfg), 'n');
dialog::add_action([this] () {