Skip to content

Commit

Permalink
port: approximately normalize eyespy bob
Browse files Browse the repository at this point in the history
  • Loading branch information
fgsfdsfgs committed Dec 6, 2023
1 parent 3118d01 commit 42af4d4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/game/bondeyespy.c
Original file line number Diff line number Diff line change
Expand Up @@ -1098,7 +1098,13 @@ void eyespyProcessInput(bool allowbuttons)
if (g_Vars.currentplayer->eyespy->bobactive || ABS(g_Vars.currentplayer->eyespy->vel.y) < 0.1f) {
g_Vars.currentplayer->eyespy->bobactive = true;
g_Vars.currentplayer->eyespy->bobtimer += g_Vars.lvupdate60;
#ifdef PLATFORM_N64
g_Vars.currentplayer->eyespy->vel.y += 0.025f * g_Vars.currentplayer->eyespy->bobdir;
#else
// HACK: how do I scale this properly?
const f32 scale = (g_Vars.lvupdate60freal <= 1.1f) ? 0.0055f : 0.0125f;
g_Vars.currentplayer->eyespy->vel.y += scale * g_Vars.lvupdate60freal * g_Vars.currentplayer->eyespy->bobdir;
#endif

if (g_Vars.currentplayer->eyespy->bobtimer > TICKS(120)) {
g_Vars.currentplayer->eyespy->bobtimer = 0;
Expand Down

0 comments on commit 42af4d4

Please sign in to comment.