1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-10-23 01:47:39 +00:00

3D:: movement in non-shmup

This commit is contained in:
?
2019-02-26 11:57:50 +01:00
committed by Zeno Rogue
parent 3188fb2e68
commit bc454d56cd
2 changed files with 23 additions and 5 deletions

View File

@@ -91,13 +91,17 @@ movedir vectodir(const hyperpoint& P) {
void remission() {
if(!canmove && (cmode & sm::NORMAL)) showMissionScreen();
}
hyperpoint move_destination_vec(int d) {
if(DIM == 2) return spin(-d * M_PI/4) * tC0(pushone());
else return cspin(0, 2, d * M_PI/4) * tC0(pushone());
}
void movepckeydir(int d) {
DEBB(DF_GRAPH, (debugfile,"movepckeydir\n"));
// EUCLIDEAN
movedir md =
vectodir(spin(-d * M_PI/4) * tC0(pushone()));
movedir md = vectodir(move_destination_vec(d));
if(!canmove) movepcto(md), remission(); else movepcto(md);
}
@@ -144,6 +148,7 @@ void calcMousedest() {
}
void mousemovement() {
if(DIM == 3) return;
calcMousedest();
if(!canmove) movepcto(mousedest), remission(); else movepcto(mousedest);
lmouseover = NULL;