Skip to content

Commit

Permalink
ChaosMod: Make "Bouncy Radar" fps-independent
Browse files Browse the repository at this point in the history
  • Loading branch information
pongo1231 committed Sep 9, 2023
1 parent b465ffe commit 79c98b8
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions ChaosMod/Effects/db/Screen/ScreenBouncyRadar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

#include "Memory/UI.h"

#define BOUNCE_SPEED_MULT 100.f

static float xOffset, yOffset, xVelocity, yVelocity, xMin, xMax, yMin, yMax;

static void OnStart()
Expand Down Expand Up @@ -43,8 +45,10 @@ static void OnTick()
yVelocity *= -1;
}

xOffset += xVelocity;
yOffset += yVelocity;
auto mult = GET_FRAME_TIME() * BOUNCE_SPEED_MULT;

xOffset += xVelocity * mult;
yOffset += yVelocity * mult;

Memory::SetRadarOffset(xOffset, yOffset);
}
Expand Down

0 comments on commit 79c98b8

Please sign in to comment.