Drop within(). Just use distance between

This commit is contained in:
Sage Vaillancourt 2025-02-26 14:51:54 -05:00
parent 876f828117
commit 8b66e2e826
1 changed files with 1 additions and 1 deletions

View File

@ -444,7 +444,7 @@ function Game:updateBatting(offenseHandler)
if isHomeRun then
playdate.timer.new(flyTimeMs, function()
-- Verify that the home run wasn't intercepted
if utils.within(1, ball.x, ballDest.x) and utils.within(1, ball.y, ballDest.y) then
if utils.distanceBetweenPoints(ball, ballDest) < 2 then
self.announcer:say("HOME RUN!")
self.state.offenseState = C.Offense.homeRun
-- Linger on the home-run ball for a moment, before panning to the bases.