From 646db5a4c356b2fe64a9a170c86e582e2928dbc2 Mon Sep 17 00:00:00 2001 From: Chad Whitely Date: Sat, 28 Feb 2026 15:35:55 -0700 Subject: [PATCH] Fix the flipped dx and dy which changed with pong-5's refactor --- pong-10/Ball.lua | 8 ++++---- pong-11/Ball.lua | 8 ++++---- pong-12/Ball.lua | 8 ++++---- pong-5/Ball.lua | 8 ++++---- pong-6/Ball.lua | 8 ++++---- pong-7/Ball.lua | 8 ++++---- pong-8/Ball.lua | 8 ++++---- pong-9/Ball.lua | 8 ++++---- 8 files changed, 32 insertions(+), 32 deletions(-) diff --git a/pong-10/Ball.lua b/pong-10/Ball.lua index be13a10..d2892a3 100644 --- a/pong-10/Ball.lua +++ b/pong-10/Ball.lua @@ -22,8 +22,8 @@ function Ball:init(x, y, width, height) -- these variables are for keeping track of our velocity on both the -- X and Y axis, since the ball can move in two dimensions - self.dy = math.random(2) == 1 and -100 or 100 - self.dx = math.random(2) == 1 and math.random(-80, -100) or math.random(80, 100) + self.dx = math.random(2) == 1 and -100 or 100 + self.dy = math.random(2) == 1 and math.random(-80, -100) or math.random(80, 100) end --[[ @@ -54,8 +54,8 @@ end function Ball:reset() self.x = VIRTUAL_WIDTH / 2 - 2 self.y = VIRTUAL_HEIGHT / 2 - 2 - self.dy = math.random(2) == 1 and -100 or 100 - self.dx = math.random(-50, 50) + self.dx = math.random(2) == 1 and -100 or 100 + self.dy = math.random(-50, 50) end --[[ diff --git a/pong-11/Ball.lua b/pong-11/Ball.lua index be13a10..d2892a3 100644 --- a/pong-11/Ball.lua +++ b/pong-11/Ball.lua @@ -22,8 +22,8 @@ function Ball:init(x, y, width, height) -- these variables are for keeping track of our velocity on both the -- X and Y axis, since the ball can move in two dimensions - self.dy = math.random(2) == 1 and -100 or 100 - self.dx = math.random(2) == 1 and math.random(-80, -100) or math.random(80, 100) + self.dx = math.random(2) == 1 and -100 or 100 + self.dy = math.random(2) == 1 and math.random(-80, -100) or math.random(80, 100) end --[[ @@ -54,8 +54,8 @@ end function Ball:reset() self.x = VIRTUAL_WIDTH / 2 - 2 self.y = VIRTUAL_HEIGHT / 2 - 2 - self.dy = math.random(2) == 1 and -100 or 100 - self.dx = math.random(-50, 50) + self.dx = math.random(2) == 1 and -100 or 100 + self.dy = math.random(-50, 50) end --[[ diff --git a/pong-12/Ball.lua b/pong-12/Ball.lua index be13a10..d2892a3 100644 --- a/pong-12/Ball.lua +++ b/pong-12/Ball.lua @@ -22,8 +22,8 @@ function Ball:init(x, y, width, height) -- these variables are for keeping track of our velocity on both the -- X and Y axis, since the ball can move in two dimensions - self.dy = math.random(2) == 1 and -100 or 100 - self.dx = math.random(2) == 1 and math.random(-80, -100) or math.random(80, 100) + self.dx = math.random(2) == 1 and -100 or 100 + self.dy = math.random(2) == 1 and math.random(-80, -100) or math.random(80, 100) end --[[ @@ -54,8 +54,8 @@ end function Ball:reset() self.x = VIRTUAL_WIDTH / 2 - 2 self.y = VIRTUAL_HEIGHT / 2 - 2 - self.dy = math.random(2) == 1 and -100 or 100 - self.dx = math.random(-50, 50) + self.dx = math.random(2) == 1 and -100 or 100 + self.dy = math.random(-50, 50) end --[[ diff --git a/pong-5/Ball.lua b/pong-5/Ball.lua index 1868831..a5b2184 100644 --- a/pong-5/Ball.lua +++ b/pong-5/Ball.lua @@ -22,8 +22,8 @@ function Ball:init(x, y, width, height) -- these variables are for keeping track of our velocity on both the -- X and Y axis, since the ball can move in two dimensions - self.dy = math.random(2) == 1 and -100 or 100 - self.dx = math.random(-50, 50) + self.dx = math.random(2) == 1 and -100 or 100 + self.dy = math.random(-50, 50) end --[[ @@ -33,8 +33,8 @@ end function Ball:reset() self.x = VIRTUAL_WIDTH / 2 - 2 self.y = VIRTUAL_HEIGHT / 2 - 2 - self.dy = math.random(2) == 1 and -100 or 100 - self.dx = math.random(-50, 50) + self.dx = math.random(2) == 1 and -100 or 100 + self.dy = math.random(-50, 50) end --[[ diff --git a/pong-6/Ball.lua b/pong-6/Ball.lua index a5c517e..1d4f685 100644 --- a/pong-6/Ball.lua +++ b/pong-6/Ball.lua @@ -22,8 +22,8 @@ function Ball:init(x, y, width, height) -- these variables are for keeping track of our velocity on both the -- X and Y axis, since the ball can move in two dimensions - self.dy = math.random(2) == 1 and -100 or 100 - self.dx = math.random(-50, 50) + self.dx = math.random(2) == 1 and -100 or 100 + self.dy = math.random(-50, 50) end --[[ @@ -54,8 +54,8 @@ end function Ball:reset() self.x = VIRTUAL_WIDTH / 2 - 2 self.y = VIRTUAL_HEIGHT / 2 - 2 - self.dy = math.random(2) == 1 and -100 or 100 - self.dx = math.random(-50, 50) + self.dx = math.random(2) == 1 and -100 or 100 + self.dy = math.random(-50, 50) end --[[ diff --git a/pong-7/Ball.lua b/pong-7/Ball.lua index be13a10..d2892a3 100644 --- a/pong-7/Ball.lua +++ b/pong-7/Ball.lua @@ -22,8 +22,8 @@ function Ball:init(x, y, width, height) -- these variables are for keeping track of our velocity on both the -- X and Y axis, since the ball can move in two dimensions - self.dy = math.random(2) == 1 and -100 or 100 - self.dx = math.random(2) == 1 and math.random(-80, -100) or math.random(80, 100) + self.dx = math.random(2) == 1 and -100 or 100 + self.dy = math.random(2) == 1 and math.random(-80, -100) or math.random(80, 100) end --[[ @@ -54,8 +54,8 @@ end function Ball:reset() self.x = VIRTUAL_WIDTH / 2 - 2 self.y = VIRTUAL_HEIGHT / 2 - 2 - self.dy = math.random(2) == 1 and -100 or 100 - self.dx = math.random(-50, 50) + self.dx = math.random(2) == 1 and -100 or 100 + self.dy = math.random(-50, 50) end --[[ diff --git a/pong-8/Ball.lua b/pong-8/Ball.lua index be13a10..d2892a3 100644 --- a/pong-8/Ball.lua +++ b/pong-8/Ball.lua @@ -22,8 +22,8 @@ function Ball:init(x, y, width, height) -- these variables are for keeping track of our velocity on both the -- X and Y axis, since the ball can move in two dimensions - self.dy = math.random(2) == 1 and -100 or 100 - self.dx = math.random(2) == 1 and math.random(-80, -100) or math.random(80, 100) + self.dx = math.random(2) == 1 and -100 or 100 + self.dy = math.random(2) == 1 and math.random(-80, -100) or math.random(80, 100) end --[[ @@ -54,8 +54,8 @@ end function Ball:reset() self.x = VIRTUAL_WIDTH / 2 - 2 self.y = VIRTUAL_HEIGHT / 2 - 2 - self.dy = math.random(2) == 1 and -100 or 100 - self.dx = math.random(-50, 50) + self.dx = math.random(2) == 1 and -100 or 100 + self.dy = math.random(-50, 50) end --[[ diff --git a/pong-9/Ball.lua b/pong-9/Ball.lua index be13a10..d2892a3 100644 --- a/pong-9/Ball.lua +++ b/pong-9/Ball.lua @@ -22,8 +22,8 @@ function Ball:init(x, y, width, height) -- these variables are for keeping track of our velocity on both the -- X and Y axis, since the ball can move in two dimensions - self.dy = math.random(2) == 1 and -100 or 100 - self.dx = math.random(2) == 1 and math.random(-80, -100) or math.random(80, 100) + self.dx = math.random(2) == 1 and -100 or 100 + self.dy = math.random(2) == 1 and math.random(-80, -100) or math.random(80, 100) end --[[ @@ -54,8 +54,8 @@ end function Ball:reset() self.x = VIRTUAL_WIDTH / 2 - 2 self.y = VIRTUAL_HEIGHT / 2 - 2 - self.dy = math.random(2) == 1 and -100 or 100 - self.dx = math.random(-50, 50) + self.dx = math.random(2) == 1 and -100 or 100 + self.dy = math.random(-50, 50) end --[[