mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-04-11 21:33:16 +00:00
2d3d:: inertia movement now takes rotation into account
This commit is contained in:
parent
d3f10e8e30
commit
5fbdeaa89d
12
shmup.cpp
12
shmup.cpp
@ -1786,8 +1786,16 @@ void movePlayer(monster *m, int delta) {
|
||||
avg_inertia = m->inertia;
|
||||
ld coef = m->base->land == laWestWall ? 0.65 : falling ? 0.15 : 1;
|
||||
coef /= 1000;
|
||||
m->inertia[frontdir()] += coef * playergo[cpid];
|
||||
avg_inertia[frontdir()] += coef * playergo[cpid] / 2;
|
||||
if(WDIM == 3) {
|
||||
m->inertia[frontdir()] += coef * playergo[cpid];
|
||||
avg_inertia[frontdir()] += coef * playergo[cpid] / 2;
|
||||
}
|
||||
else {
|
||||
m->inertia[0] += cos(godir[cpid]) * coef * playergo[cpid];
|
||||
avg_inertia[0] += cos(godir[cpid]) * coef * playergo[cpid] / 2;
|
||||
m->inertia[1] -= sin(godir[cpid]) * coef * playergo[cpid];
|
||||
avg_inertia[1] -= sin(godir[cpid]) * coef * playergo[cpid] / 2;
|
||||
}
|
||||
if(falling) {
|
||||
vector<cell*> below;
|
||||
manual_celllister mcl;
|
||||
|
Loading…
x
Reference in New Issue
Block a user