1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-12-19 20:38:09 +00:00

improved mobile compass

This commit is contained in:
Zeno Rogue
2018-07-23 16:08:08 +02:00
parent e601533a37
commit c70db33417
3 changed files with 23 additions and 12 deletions

View File

@@ -898,9 +898,11 @@ bool handleCompass() {
if(h < rad) {
if(h < rad*SKIPFAC) movepcto(MD_WAIT);
else {
double d = vid.revcontrol ? -1 : 1;
mouseh = hpxy(dx * d / rad, dy * d / rad);
mousemovement();
hyperpoint param = hpxy(dx * 1. / rad, dy * 1. / rad);
movedir md = vectodir(param);
if(!canmove) movepcto(md), remission(); else movepcto(md);
}
getcstat = 0;
return true;