Drop within(). Just use distance between
This commit is contained in:
parent
876f828117
commit
8b66e2e826
|
@ -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.
|
||||
|
|
Loading…
Reference in New Issue