From 5df107f76732ce1c24f9da47fe9942f63ae723be Mon Sep 17 00:00:00 2001 From: Sage Vaillancourt Date: Sun, 26 Jan 2025 16:14:55 -0500 Subject: [PATCH] Remove testing-things-out cruft. --- src/main.lua | 72 ---------------------------------------------------- 1 file changed, 72 deletions(-) diff --git a/src/main.lua b/src/main.lua index d77a0fa..5af58f5 100644 --- a/src/main.lua +++ b/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