1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2026-01-26 12:43:33 +00:00

fixed_facing option, not only in racing

This commit is contained in:
Zeno Rogue
2019-01-17 14:09:00 +01:00
parent 92d98847fb
commit 94ce1eb541
3 changed files with 50 additions and 1 deletions

View File

@@ -981,6 +981,16 @@ void drawEuclidean() {
}
void spinEdge(ld aspd) {
if(playerfound && vid.fixed_facing) {
hyperpoint H = gpushxto0(playerV * C0) * playerV * xpush0(5);
downspin = atan2(H[1], H[0]);
downspin += vid.fixed_facing_dir * degree;
if(flipplayer) downspin += M_PI;
while(downspin < -M_PI) downspin += 2*M_PI;
while(downspin > +M_PI) downspin -= 2*M_PI;
aspd = (1 + 2 * abs(downspin)) * aspd;
}
if(downspin > aspd) downspin = aspd;
if(downspin < -aspd) downspin = -aspd;
View = spin(downspin) * View;