mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-11-23 21:07:17 +00:00
fixed the player going through walls in shmup
This commit is contained in:
parent
3ef16bf6f3
commit
97c405fc87
20
shmup.cpp
20
shmup.cpp
@ -1572,12 +1572,20 @@ void movePlayer(monster *m, int delta) {
|
||||
|
||||
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++) {
|
||||
|
||||
go = true;
|
||||
|
||||
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]);
|
||||
|
||||
@ -1810,6 +1818,16 @@ void movePlayer(monster *m, int delta) {
|
||||
}
|
||||
}
|
||||
|
||||
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) {
|
||||
|
||||
visibleFor(500);
|
||||
|
Loading…
Reference in New Issue
Block a user