3D:: movement in non-shmup

This commit is contained in:
? authored and Zeno Rogue committed 2019-09-12 22:38:40 +02:00
1 parent 3188fb2e68
commit bc454d56cd
2 files changed
+23 -5

No files matched your search

+9 -4
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;