test: straferun doublejump

git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@3884 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
driAn
2008-12-06 13:34:49 +00:00
parent 3ef184e1d8
commit 306dce008c
2 changed files with 15 additions and 4 deletions
+12 -2
View File
@@ -427,9 +427,19 @@ void moveplayer(physent *pl, int moveres, bool local, int curtime)
if(pl->jumpnext)
{
pl->jumpnext = false;
pl->vel.z = 2.0f; // physics impulse upwards
if(water) { pl->vel.x /= 8; pl->vel.y /= 8; } // dampen velocity change even harder, gives correct water feel
pl->vel.z = 2.0f; // physics impulse upwards
bool doublejump = pl->lastjump && lastmillis-pl->lastjump < 250 && pl->strafe != 0;
if(doublejump) // more velocity on double jump
{
pl->vel.mul(1.25f);
}
if(water) // dampen velocity change even harder, gives correct water feel
{
pl->vel.x /= 8.0f;
pl->vel.y /= 8.0f;
}
else if(pl==player1 || pl->type!=ENT_PLAYER) audiomgr.playsoundc(S_JUMP, pl);
pl->lastjump = lastmillis;
}
pl->timeinair = 0;
}