mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-11-27 14:37:16 +00:00
fixed the player going through walls in shmup
This commit is contained in:
parent
3ef16bf6f3
commit
97c405fc87
22
shmup.cpp
22
shmup.cpp
@ -1571,14 +1571,22 @@ void movePlayer(monster *m, int delta) {
|
|||||||
m->footphase += playergo[cpid];
|
m->footphase += playergo[cpid];
|
||||||
|
|
||||||
if(isReptile(m->base->wall)) m->base->wparam = reptilemax();
|
if(isReptile(m->base->wall)) m->base->wparam = reptilemax();
|
||||||
|
|
||||||
|
int steps = 1 + abs(int(playergo[cpid] / (.2 * scalefactor)));
|
||||||
|
|
||||||
|
playergo[cpid] /= steps;
|
||||||
|
|
||||||
|
nextstep:
|
||||||
|
|
||||||
|
transmatrix nat1 = nat;
|
||||||
|
|
||||||
for(int igo=0; igo<IGO && !go; igo++) {
|
for(int igo=0; igo<IGO && !go; igo++) {
|
||||||
|
|
||||||
go = true;
|
go = true;
|
||||||
|
|
||||||
if(playergo[cpid])
|
if(playergo[cpid])
|
||||||
nat = nat * spin(igospan[igo]) * xpush(playergo[cpid]) * spin(-igospan[igo]);
|
nat = nat1 * spin(igospan[igo]) * xpush(playergo[cpid]) * spin(-igospan[igo]);
|
||||||
|
|
||||||
// spin(span[igo]) * xpush(playergo[cpid]) * spin(-span[igo]);
|
// spin(span[igo]) * xpush(playergo[cpid]) * spin(-span[igo]);
|
||||||
|
|
||||||
c2 = m->findbase(nat);
|
c2 = m->findbase(nat);
|
||||||
@ -1809,6 +1817,16 @@ void movePlayer(monster *m, int delta) {
|
|||||||
else if(isWall(c3)) break;
|
else if(isWall(c3)) break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(go) {
|
||||||
|
// printf("#%3d: at %s\n", steps, display(nat * C0));
|
||||||
|
steps--;
|
||||||
|
if(steps > 0) {
|
||||||
|
nat0 = nat;
|
||||||
|
go = false;
|
||||||
|
goto nextstep;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(shotkey && canmove && curtime >= m->nextshot) {
|
if(shotkey && canmove && curtime >= m->nextshot) {
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user