Fix catcher's catchable width being half of what it should

This commit is contained in:
Dean Herbert 2018-01-03 21:31:16 +09:00
parent 6e8e82e264
commit f45752c652
1 changed files with 3 additions and 3 deletions

View File

@ -190,15 +190,15 @@ public void Add(DrawableHitObject fruit)
/// <returns>Whether the catch is possible.</returns>
public bool AttemptCatch(CatchHitObject fruit)
{
const double relative_catcher_width = CATCHER_SIZE / 2;
double halfCatcherWidth = CATCHER_SIZE * Math.Abs(Scale.X) * 0.5f;
// this stuff wil disappear once we move fruit to non-relative coordinate space in the future.
var catchObjectPosition = fruit.X * CatchPlayfield.BASE_WIDTH;
var catcherPosition = Position.X * CatchPlayfield.BASE_WIDTH;
var validCatch =
catchObjectPosition >= catcherPosition - relative_catcher_width / 2 &&
catchObjectPosition <= catcherPosition + relative_catcher_width / 2;
catchObjectPosition >= catcherPosition - halfCatcherWidth &&
catchObjectPosition <= catcherPosition + halfCatcherWidth;
if (validCatch && fruit.HyperDash)
{