Remove testing-things-out cruft.
This commit is contained in:
parent
e81c27f00e
commit
5df107f767
72
src/main.lua
72
src/main.lua
|
@ -59,12 +59,10 @@ function playdate.AButtonDown()
|
|||
end
|
||||
|
||||
function playdate.upButtonDown()
|
||||
-- hitMult += 1
|
||||
batBaseY -= 1
|
||||
end
|
||||
|
||||
function playdate.downButtonDown()
|
||||
-- hitMult -= 1
|
||||
batBaseY += 1
|
||||
end
|
||||
|
||||
|
@ -79,39 +77,7 @@ end
|
|||
local pitchClockSec = 5
|
||||
local elapsedTime = 0
|
||||
|
||||
-- No-abs failure
|
||||
-- Hit early!
|
||||
-- {
|
||||
-- [b] = 220,
|
||||
-- [ballX] = 200,
|
||||
-- [ballY] = 138.2103,
|
||||
-- [batBaseX] = 166.0,
|
||||
-- [batBaseY] = 220,
|
||||
-- [batTipX] = 207.4227,
|
||||
-- [batTipY] = 202.4171,
|
||||
-- [m] = -0.4244749,
|
||||
-- [mx] = -84.89497,
|
||||
-- [mxPlusB] = 135.105,
|
||||
-- [x] = 200,
|
||||
-- [y] = 135.105,
|
||||
-- }
|
||||
|
||||
|
||||
-- With-abs failure
|
||||
-- Did not hit!
|
||||
-- {
|
||||
-- [b] = 220,
|
||||
-- [ballY] = 234.121,
|
||||
-- [m] = 0.4244749,
|
||||
-- [mx] = 84.89497,
|
||||
-- [mxPlusB] = 304.895,
|
||||
-- [x] = 200,
|
||||
-- [y] = 304.895,
|
||||
-- }
|
||||
|
||||
|
||||
function ballPassedThruBat(ballX, ballY, batBaseX, batBaseY, batTipX, batTipY)
|
||||
|
||||
-- This check currently assumes right-handedness.
|
||||
-- I.e. it assumes the ball is to the right of batBaseX
|
||||
if ballX < batBaseX or ballX > batTipX or ballY > screenH then
|
||||
|
@ -127,39 +93,7 @@ function ballPassedThruBat(ballX, ballY, batBaseX, batBaseY, batTipX, batTipY)
|
|||
local yP = ballY
|
||||
local yDelta = yOnLine - yP
|
||||
|
||||
-- printTable({
|
||||
-- m = m,
|
||||
-- mx = m * ballX,
|
||||
-- mxPlusB = y,
|
||||
-- y = y,
|
||||
-- x = ballX,
|
||||
-- b = batBaseY,
|
||||
-- ballY = ballY,
|
||||
-- ballX = ballX,
|
||||
-- batTipY = batTipY,
|
||||
-- batBaseY = batBaseY,
|
||||
-- batTipX = batTipX,
|
||||
-- batBaseX = batBaseX
|
||||
-- })
|
||||
printTable({
|
||||
b = batBaseY,
|
||||
m = m,
|
||||
yOnLine = yOnLine,
|
||||
yP = yP,
|
||||
yDelta = yDelta,
|
||||
batTipY = batTipY,
|
||||
batBaseY = batBaseY,
|
||||
batTipX = batTipX,
|
||||
batBaseX = batBaseX
|
||||
})
|
||||
|
||||
return yDelta <= 0
|
||||
|
||||
-- return ballY > y
|
||||
|
||||
-- -- return (lastBallY - 2) < batTipY and ballY >= batTipY and batTipX > ballX
|
||||
-- -- return math.abs(batTipX - ballX) < 10
|
||||
-- return (math.abs(ballY - batTipY) < 10) and (batTipX > ballX)
|
||||
end
|
||||
|
||||
function updateGameState()
|
||||
|
@ -173,8 +107,6 @@ function updateGameState()
|
|||
end
|
||||
|
||||
if hit then
|
||||
-- ballX = ballX + ballVelX
|
||||
-- ballY = ballY + ballVelY
|
||||
ballX = hitAnimatorX:currentValue()
|
||||
ballY = hitAnimatorY:currentValue()
|
||||
ballSize = ballSizeAnimator:currentValue()
|
||||
|
@ -209,7 +141,6 @@ end
|
|||
function playdate.update()
|
||||
updateGameState()
|
||||
|
||||
-- gfx.clear()
|
||||
grassBackground:draw(0, 0)
|
||||
|
||||
gfx.setColor(gfx.kColorBlack)
|
||||
|
@ -219,9 +150,6 @@ function playdate.update()
|
|||
gfx.setLineWidth(5)
|
||||
gfx.drawLine(batBaseX, batBaseY, batTipX, batTipY)
|
||||
|
||||
-- gfx.drawText("Hit Mult:", 3, screenH - 15)
|
||||
-- gfx.drawText(hitMult, 65, screenH - 15)
|
||||
|
||||
if playdate.isCrankDocked() then
|
||||
playdate.ui.crankIndicator:draw()
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue