Browse Source

remove use of Math.Clamp()

main
Colin McMillen 3 months ago
parent
commit
f05142066d
  1. 3
      Shared/SpiderWorld.cs

3
Shared/SpiderWorld.cs

@ -23,7 +23,8 @@ namespace SemiColinGames {
public void Update(float modelTime, History<Input> input) {
radius += 150 * modelTime * input[0].Motion.Y;
radius = Math.Clamp(radius, 50, 200);
radius = Math.Min(radius, 200);
radius = Math.Max(radius, 50);
float angleChange = modelTime * momentum / radius;
angle += angleChange;
float x = anchor.X + radius * (float) Math.Sin(angle);

Loading…
Cancel
Save