mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-01-23 07:27:07 +00:00
3D:: movement in non-shmup
This commit is contained in:
parent
3188fb2e68
commit
bc454d56cd
13
control.cpp
13
control.cpp
@ -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;
|
||||
|
15
graph.cpp
15
graph.cpp
@ -5314,6 +5314,12 @@ void fallingMonsterAnimation(cell *c, eMonster m, int id) {
|
||||
void queuecircleat(cell *c, double rad, color_t col) {
|
||||
if(!c) return;
|
||||
if(!gmatrix.count(c)) return;
|
||||
if(DIM == 3) {
|
||||
dynamicval<color_t> p(poly_outline, col);
|
||||
for(int i=0; i<c->type; i++)
|
||||
queuepolyat(gmatrix[c], shBinaryWall[i], 0, PPR::LINE);
|
||||
return;
|
||||
}
|
||||
#if CAP_SHAPES
|
||||
if(vid.stereo_mode || sphere) {
|
||||
dynamicval<color_t> p(poly_outline, col);
|
||||
@ -5442,7 +5448,7 @@ void drawMarkers() {
|
||||
|
||||
// process mouse
|
||||
#if CAP_SHAPES
|
||||
if((vid.axes == 4 || (vid.axes == 1 && !mousing)) && !shmup::on) {
|
||||
if((vid.axes == 4 || (vid.axes == 1 && !mousing)) && !shmup::on && DIM == 2) {
|
||||
if(multi::players == 1) {
|
||||
forCellIdAll(c2, d, cwt.at) IG(c2) drawMovementArrows(c2, confusingGeometry() ? Gm(cwt.at) * calc_relative_matrix(c2, cwt.at, d) : Gm(c2));
|
||||
}
|
||||
@ -5456,6 +5462,12 @@ void drawMarkers() {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(DIM == 3 && !inHighQual && !shmup::on && vid.axes) {
|
||||
movedir md = vectodir(move_destination_vec(6));
|
||||
cellwalker xc = cwt + md.d + wstep;
|
||||
IG(xc.at) queuecircleat(xc.at, .8, getcs().uicolor);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -5803,6 +5815,7 @@ void drawthemap() {
|
||||
void drawmovestar(double dx, double dy) {
|
||||
|
||||
if(viewdists) return;
|
||||
if(DIM == 3) return;
|
||||
|
||||
DEBB(DF_GRAPH, (debugfile,"draw movestar\n"));
|
||||
if(!playerfound) return;
|
||||
|
Loading…
Reference in New Issue
Block a user