mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-12-25 01:20:37 +00:00
racing:: efficient braking, stop when hit wall
This commit is contained in:
parent
10b664097f
commit
65f07aa30a
@ -1625,6 +1625,8 @@ void movePlayer(monster *m, int delta) {
|
|||||||
if(!canmove) mgo = 0;
|
if(!canmove) mgo = 0;
|
||||||
|
|
||||||
if(racing::on) {
|
if(racing::on) {
|
||||||
|
// braking is more efficient
|
||||||
|
if(m->vel * mgo < 0) mgo *= 3;
|
||||||
m->vel += mgo * delta / 600;
|
m->vel += mgo * delta / 600;
|
||||||
playergo[cpid] = m->vel * SCALE * delta / 600;
|
playergo[cpid] = m->vel * SCALE * delta / 600;
|
||||||
printf("vel = %lf go = %lf\n", m->vel, playergo[cpid]);
|
printf("vel = %lf go = %lf\n", m->vel, playergo[cpid]);
|
||||||
@ -1896,6 +1898,10 @@ void movePlayer(monster *m, int delta) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if CAP_RACING
|
||||||
|
if(!go && racing::on) m->vel = 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
if(shotkey && canmove && curtime >= m->nextshot) {
|
if(shotkey && canmove && curtime >= m->nextshot) {
|
||||||
|
|
||||||
visibleFor(500);
|
visibleFor(500);
|
||||||
|
Loading…
Reference in New Issue
Block a user