Linting, and pitcherIsReady() timing tweak
This commit is contained in:
parent
699dab8c7d
commit
56a5e197cd
|
@ -18,10 +18,9 @@ function throwMeter:draw(x, y)
|
|||
-- Or maybe dither if it's too soft - bend if it's too hard
|
||||
end
|
||||
|
||||
|
||||
function throwMeter:drawNearFielder(fielder)
|
||||
if not fielder then
|
||||
return
|
||||
end
|
||||
throwMeter:draw(fielder.x - 25, fielder.y - 10)
|
||||
end
|
||||
end
|
||||
|
|
20
src/main.lua
20
src/main.lua
|
@ -565,12 +565,12 @@ function Game:updateGameState()
|
|||
-- Give the player a moment to enjoy their home run.
|
||||
playdate.timer.new(1500, function()
|
||||
self:returnToPitcher()
|
||||
end)
|
||||
actionQueue:upsert("waitForPitcherToHaveBall", 10000, function()
|
||||
while not self:pitcherIsReady() do
|
||||
coroutine.yield()
|
||||
end
|
||||
self.state.offenseState = C.Offense.batting
|
||||
actionQueue:upsert("waitForPitcherToHaveBall", 10000, function()
|
||||
while not self:pitcherIsReady() do
|
||||
coroutine.yield()
|
||||
end
|
||||
self.state.offenseState = C.Offense.batting
|
||||
end)
|
||||
end)
|
||||
end
|
||||
end
|
||||
|
@ -604,12 +604,8 @@ function Game:update()
|
|||
local ballHeldBy
|
||||
for _, fielder in pairs(self.fielding.fielders) do
|
||||
addDraw(fielder.y + danceOffset, function()
|
||||
local ballHeldByThisFielder = drawFielder(
|
||||
self.state.fieldingTeamSprites,
|
||||
self.state.ball,
|
||||
fielder.x,
|
||||
fielder.y + danceOffset
|
||||
)
|
||||
local ballHeldByThisFielder =
|
||||
drawFielder(self.state.fieldingTeamSprites, self.state.ball, fielder.x, fielder.y + danceOffset)
|
||||
if ballHeldByThisFielder then
|
||||
ballHeldBy = fielder
|
||||
end
|
||||
|
|
|
@ -66,7 +66,7 @@ end
|
|||
function pitchTracker:recordIfPassed(ball)
|
||||
if ball.y < C.StrikeZoneStartY then
|
||||
self.recordedPitchX = nil
|
||||
elseif not pitchTracker.recordedPitchX then
|
||||
elseif not self.recordedPitchX then
|
||||
self.recordedPitchX = ball.x
|
||||
end
|
||||
end
|
||||
|
@ -158,4 +158,4 @@ function throwMeter:applyCharge(chargeAmount)
|
|||
else
|
||||
return nil
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue